app/soc/logic/models/grading_record.py
changeset 2622 f37d7d564f88
parent 2617 274efd5c769d
child 2626 17dd9ada27cb
equal deleted inserted replaced
2621:4fef5b98c67b 2622:f37d7d564f88
    79       records_to_store.append(record_entity)
    79       records_to_store.append(record_entity)
    80 
    80 
    81     # batch put and return the entities
    81     # batch put and return the entities
    82     return db.put(records_to_store)
    82     return db.put(records_to_store)
    83 
    83 
    84 
       
    85   def getFieldsForGradingRecord(self, project, survey_group,
    84   def getFieldsForGradingRecord(self, project, survey_group,
    86                                 record_entity=None):
    85                                 record_entity=None):
    87     """Returns the fields for a GradingRecord.
    86     """Returns the fields for a GradingRecord.
    88 
    87 
    89     See GradingRecord model for description of the grade_decision value.
    88     See GradingRecord model for description of the grade_decision value.
   110                                                        unique=True)
   109                                                        unique=True)
   111 
   110 
   112     if student_survey:
   111     if student_survey:
   113       # retrieve ProjectSurveyRecord
   112       # retrieve ProjectSurveyRecord
   114       survey_record_fields['survey'] = student_survey
   113       survey_record_fields['survey'] = student_survey
   115       project_survey_record = project_logic.getForFields(survey_record_fields, unique=True)
   114       project_survey_record = project_logic.getForFields(survey_record_fields,
       
   115                                                          unique=True)
   116     else:
   116     else:
   117       project_survey_record = None
   117       project_survey_record = None
   118 
   118 
   119     # set the necessary fields
   119     # set the necessary fields
   120     fields = {'grading_survey_group': survey_group,
   120     fields = {'grading_survey_group': survey_group,