Changeset 7918 for main/waeup.kofa/trunk
- Timestamp:
- 19 Mar 2012, 06:52:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r7907 r7918 81 81 82 82 class SubjectSource(BasicSourceFactory): 83 83 """A source for school subjects used in exam documentation. 84 """ 84 85 def getValues(self): 85 86 subjects_dict = getUtility(IKofaUtils).EXAM_SUBJECTS_DICT … … 91 92 92 93 class GradeSource(BasicSourceFactory): 93 94 """A source for exam grades. 95 """ 94 96 def getValues(self): 95 grades_dict = getUtility(IKofaUtils).EXAM_GRADES_DICT 96 return [value[0] for value in 97 sorted(grades_dict.items(), key=lambda item: item[1][0])] 97 for entry in getUtility(IKofaUtils).EXAM_GRADES: 98 yield entry[0] 98 99 99 100 def getTitle(self, value): 100 grades_dict = getUtility(IKofaUtils).EXAM_GRADES_DICT 101 return grades_dict[value][1] 101 return dict(getUtility(IKofaUtils).EXAM_GRADES)[value] 102 102 103 103 # Define a validation method for email addresses
Note: See TracChangeset for help on using the changeset viewer.