Ignore:
Timestamp:
16 Nov 2012, 21:56:03 (12 years ago)
Author:
Henrik Bettermann
Message:

Ease customization of MODE_GROUPS.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports.py

    r9648 r9649  
    2121from zope.interface import implementer, Interface
    2222from waeup.kofa.interfaces import (
    23      academic_sessions_vocab, registration_states_vocab)
     23    IKofaUtils,
     24    academic_sessions_vocab, registration_states_vocab)
    2425from waeup.kofa.interfaces import MessageFactory as _
    2526from 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     }
    3427
    3528class IStudentReport(IReport):
     
    6861    result = cat.searchResults(current_session=(session, session))
    6962    table = [[0 for x in xrange(len(states))] for y in xrange(len(fac_codes))]
     63    mode_groups = getUtility(IKofaUtils).MODE_GROUPS
    7064    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]:
    7266            continue
    7367        row = fac_codes.index(stud.faccode)
     
    221215
    222216    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()])
    224219        return
    225220
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r9543 r9649  
    159159        'gown': 'Gown Hire Fee',
    160160        'application': 'Application Fee'
     161        }
     162
     163    MODE_GROUPS = {
     164        'All':('all',),
     165        'Undergraduate Full-Time':('ug_ft',),
     166        'Undergraduate Part-Time':('ug_pt',),
     167        'Postgraduate Full-Time':('pg_ft',),
     168        'Postgraduate Part-Time':('pg_pt',),
    161169        }
    162170
Note: See TracChangeset for help on using the changeset viewer.