Changeset 9649 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 16 Nov 2012, 21:56:03 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports.py
r9648 r9649 21 21 from zope.interface import implementer, Interface 22 22 from waeup.kofa.interfaces import ( 23 academic_sessions_vocab, registration_states_vocab) 23 IKofaUtils, 24 academic_sessions_vocab, registration_states_vocab) 24 25 from waeup.kofa.interfaces import MessageFactory as _ 25 26 from waeup.kofa.reports import IReport 26 27 MODE_GROUPS = {28 'All':('all',),29 'Undergraduate Full-Time':('ug_ft',),30 'Undergraduate Part-Time':('ug_pt',),31 'Postgraduate Full-Time':('pg_ft',),32 'Postgraduate Part-Time':('pg_pt',),33 }34 27 35 28 class IStudentReport(IReport): … … 68 61 result = cat.searchResults(current_session=(session, session)) 69 62 table = [[0 for x in xrange(len(states))] for y in xrange(len(fac_codes))] 63 mode_groups = getUtility(IKofaUtils).MODE_GROUPS 70 64 for stud in result: 71 if mode != 'All' and stud.current_mode not in MODE_GROUPS[mode]:65 if mode != 'All' and stud.current_mode not in mode_groups[mode]: 72 66 continue 73 67 row = fac_codes.index(stud.faccode) … … 221 215 222 216 def _set_mode_values(self): 223 self.modes = sorted([(key, key) for key in MODE_GROUPS.keys()]) 217 mode_groups = getUtility(IKofaUtils).MODE_GROUPS 218 self.modes = sorted([(key, key) for key in mode_groups.keys()]) 224 219 return 225 220
Note: See TracChangeset for help on using the changeset viewer.