# HG changeset patch # User Lennard de Rijk # Date 1249848227 25200 # Node ID 22f41aafcedc47b2f1c03fb38ef41364512d087d # Parent 5723f329d098d7699e5766d8707a8fbdf33d4855 Added capability to update a single GradingRecord on the edit page. diff -r 5723f329d098 -r 22f41aafcedc app/soc/templates/soc/grading_record/edit.html --- a/app/soc/templates/soc/grading_record/edit.html Sat Aug 08 18:42:22 2009 +0100 +++ b/app/soc/templates/soc/grading_record/edit.html Sun Aug 09 13:03:47 2009 -0700 @@ -49,13 +49,16 @@ - + - + - + + + + diff -r 5723f329d098 -r 22f41aafcedc app/soc/views/models/grading_survey_group.py --- a/app/soc/views/models/grading_survey_group.py Sat Aug 08 18:42:22 2009 +0100 +++ b/app/soc/views/models/grading_survey_group.py Sun Aug 09 13:03:47 2009 -0700 @@ -420,6 +420,18 @@ record_entity: a GradingRecord entity """ + survey_group_logic = params['logic'] + record_logic = survey_group_logic.getRecordLogic() + + get_dict = request.GET + + if get_dict.get('update'): + # try to update this record + properties = record_logic.getFieldsForGradingRecord( + record_entity.project, record_entity.grading_survey_group, + record_entity) + record_logic.updateEntityProperties(record_entity, properties) + form = params['record_edit_form'](instance=record_entity) context['form'] = form