Commit 1a29ab37 authored by Marc Duez's avatar Marc Duez

server : store sequence filename

parent 76c979f5
......@@ -111,10 +111,15 @@ def add_file_form():
response.headers['Access-Control-Max-Age'] = 86400
id = db.sequence_file.insert(data_file = request.vars.file )
query = db( ( db.sequence_file.id==id)).select()
for row in query :
name = db.sequence_file.data_file.retrieve(row.data_file)[0]
db.sequence_file[id] = dict(sampling_date=request.vars['sampling_date'],
info=request.vars['file_info'],
patient_id=request.vars['patient_id'])
patient_id=request.vars['patient_id'],
filename=name)
res = {"success": "true" }
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
......
......@@ -100,6 +100,7 @@ db.define_table('sequence_file',
Field('patient_id', 'reference patient'),
Field('sampling_date','date'),
Field('info','text'),
Field('filename','text'),
Field('size_file','integer'),
Field('data_file', 'upload',autodelete=True, length=1000000000000))
......
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