Commit cf29b5ca authored by marc's avatar marc

run.py: store pcr/sequencer info

parent 9795543b
......@@ -178,7 +178,23 @@ def index():
## return form to create new run
def add():
if (auth.can_create_patient()):
return dict(message=T('add run'))
sequencer_list = db(
db.run.id>0
).select(
db.run.sequencer,
distinct=True
)
pcr_list = db(
db.run.id>0
).select(
db.run.pcr,
distinct=True
)
return dict(message=T('add run'),
sequencer_list = sequencer_list,
pcr_list = pcr_list)
else :
res = {"message": ACCESS_DENIED}
log.error(res)
......@@ -211,6 +227,8 @@ def add_form():
run_date=request.vars["run_date"],
info=request.vars["info"],
id_label=request.vars["id_label"],
sequencer=request.vars["sequencer"],
pcr=request.vars["pcr"],
creator=auth.user_id)
......@@ -248,7 +266,23 @@ def add_form():
## return edit form
def edit():
if (auth.can_modify_run(request.vars["id"]) ):
return dict(message=T('edit patient'))
sequencer_list = db(
db.run.id>0
).select(
db.run.sequencer,
distinct=True
)
pcr_list = db(
db.run.id>0
).select(
db.run.pcr,
distinct=True
)
return dict(message=T('edit run'),
sequencer_list = sequencer_list,
pcr_list = pcr_list)
else :
res = {"message": ACCESS_DENIED}
log.error(res)
......@@ -277,6 +311,8 @@ def edit_form():
db.patient[request.vars["id"]] = dict(name=request.vars["name"],
run_date=request.vars["run_date"],
info=request.vars["info"],
sequencer=request.vars["sequencer"],
pcr=request.vars["pcr"],
id_label=request.vars["id_label"]
)
......
......@@ -124,6 +124,8 @@ db.define_table('run',
Field('info','text'),
Field('id_label','string'),
Field('creator','reference auth_user'),
Field('sequencer','string'),
Field('pcr','string'),
Field('sample_set_id','reference sample_set', ondelete='SET NULL'))
......
......@@ -20,9 +20,27 @@
</tr>
<tr>
<td><label for="run_info" id="run_info__label">Info: </label></td>
<td><textarea class="text" cols="40" id="run_info" name="info" rows="10"></textarea></td>
<td><textarea class="text" cols="60" id="run_info" name="info" rows="10"></textarea></td>
<td></td>
</tr>
<tr>
<td><label for="sequencer" id="sequencer__label">Sequencer: </label></td>
<td><input list="sequencer" id="sequencer" name="sequencer" type="text" size="40" value=""></td>
<datalist id="sequencer">
{{for row in sequencer_list :}}
<option value="{{=row['sequencer']}}">
{{pass}}
</datalist>
</tr>
<tr>
<td><label for="pcr" id="pcr__label">PCR </label></td>
<td><input list="pcr" id="pcr" name="pcr" type="text" size="40" value=""></td>
<datalist id="pcr">
{{for row in pcr_list :}}
<option value="{{=row['pcr']}}">
{{pass}}
</datalist>
</tr>
<tr>
<td></td>
<td ><input type="submit" value="save" class="btn"></td>
......
......@@ -25,9 +25,27 @@ info = db.run[request.vars["id"]]
</tr>
<tr>
<td> <label for="run_info" id="run_info__label">Info: </label> </td>
<td> <textarea class="text" cols="40" id="run_info" name="info" rows="10">{{=info.info}}</textarea> </td>
<td> <textarea class="text" cols="60" id="run_info" name="info" rows="10">{{=info.info}}</textarea> </td>
<td></td>
</tr>
<tr>
<td><label for="sequencer" id="sequencer__label">Sequencer: </label></td>
<td><input list="sequencer" id="sequencer" name="sequencer" type="text" size="40" value="{{=info.sequencer}}"></td>
<datalist id="sequencer">
{{for row in sequencer_list :}}
<option value="{{=row['sequencer']}}">
{{pass}}
</datalist>
</tr>
<tr>
<td><label for="pcr" id="pcr__label">PCR </label></td>
<td><input list="pcr" id="pcr" name="pcr" type="text" size="40" value="{{=info.pcr}}"></td>
<datalist id="pcr">
{{for row in pcr_list :}}
<option value="{{=row['pcr']}}">
{{pass}}
</datalist>
</tr>
<tr>
<td> </td>
<td> <input type="submit" value="Soumettre" class="btn"> </td>
......
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