Commit 254ad21b authored by HERBERT Ryan's avatar HERBERT Ryan Committed by Vidjil Team

databse.js model_loader.js default.py save annotations

annotations are now save when using save_analysis
parent 1d7ba7a1
......@@ -580,6 +580,9 @@ Database.prototype = {
});
var fd = new FormData();
fd.append("fileToUpload", blob);
fd.append("patient_info", self.m.info);
fd.append("samples_info", self.m.samples.info);
fd.append("samples_id", self.m.samples.ids);
$.ajax({
type: "POST",
......
......@@ -505,6 +505,7 @@ Model_loader.prototype = {
var analysisData = {
producer : "browser",
info : this.info,
timestamp : timestamp,
vidjil_json_version : VIDJIL_JSON_VERSION,
samples : this.samples,
......
......@@ -365,6 +365,15 @@ def save_analysis():
analyze_date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
)
db(db.patient.id == request.vars['patient']).update(info = request.vars['patient_info']);
ids = request.vars['samples_id'].split(',')
infos = request.vars['samples_info'].split(',')
# TODO find way to remove loop ?
for i in range(0, len(ids)):
db(db.sequence_file.id == int(ids[i])).update(info = infos[i])
patient_name = db.patient[request.vars['patient']].first_name + " " + db.patient[request.vars['patient']].last_name
res = {"success" : "true",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment