Commit c124fe14 authored by HERBERT Ryan's avatar HERBERT Ryan Committed by Vidjil Team

database.js, default.py save_sample_info

  Added a save_sample_info method to the Database prototype that uses the Database
  request method to asynchronously call the file.py save_info route.
  It was therefore necessary to include the database ids to the .data
  file to ensure the link could be maintained.
parent cb9d6dd6
......@@ -818,6 +818,14 @@ Database.prototype = {
return args
},
save_sample_info: function (sample_id, info) {
self.m.samples["info"][sample_id] = info;
var database_id = self.m.samples["ids"][sample_id];
self.request('file/save_info', {id: database_id, value: info});
},
// Log functions, to server
// 'quiet' is set to true to avoid infinite loops with timeouts
......
......@@ -232,6 +232,7 @@ def get_data():
for i in range(len(data["samples"]["original_names"])) :
data_file = data["samples"]["original_names"][i]
if row.sequence_file.data_file == data_file :
data["samples"]["ids"][i] = row.sequence_file.id
data["samples"]["original_names"][i] = filename
data["samples"]["timestamp"][i] = str(row.sequence_file.sampling_date)
data["samples"]["info"][i] = row.sequence_file.info
......
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