Ignore:
Timestamp:
12 Mar 2012, 08:04:03 (13 years ago)
Author:
Henrik Bettermann
Message:

We don't need methods to fetch dictionaries.

Update interfaces.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

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

    r7834 r7841  
    552552    def current_mode(self):
    553553        if self.context.certificate is not None:
    554             studymodes_dict = getUtility(IKofaUtils).getStudyModesDict()
     554            studymodes_dict = getUtility(IKofaUtils).STUDY_MODES_DICT
    555555            return studymodes_dict[self.context.certificate.study_mode]
    556556        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r7819 r7841  
    4040    """
    4141    def getValues(self, context):
    42         verdicts_dict = getUtility(IStudentsUtils).getVerdictsDict()
     42        verdicts_dict = getUtility(IStudentsUtils).VERDICTS_DICT
    4343        return verdicts_dict.keys()
    4444
     
    4747
    4848    def getTitle(self, context, value):
    49         verdicts_dict = getUtility(IStudentsUtils).getVerdictsDict()
     49        verdicts_dict = getUtility(IStudentsUtils).VERDICTS_DICT
    5050        return verdicts_dict[value]
    5151
     
    5555
    5656    """
     57    def setReturningData(student):
     58        """ This method defines what happens after school fee payment
     59        depending on the student's senate verdict.
     60
     61        In the base configuration current level is always increased
     62        by 100 no matter which verdict has been assigned.
     63        """
     64
    5765    def getPaymentDetails(category, student):
    5866        """Get the payment dates of a student for the payment category
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r7819 r7841  
    177177
    178178    def setReturningData(self, student):
     179        """ This method defines what happens after school fee payment
     180        depending on the student's senate verdict.
     181
     182        In the base configuration current level is always increased
     183        by 100 no matter which verdict has been assigned.
     184        """
    179185        student['studycourse'].current_level += 100
    180186        student['studycourse'].current_session += 1
     
    185191
    186192    def getPaymentDetails(self, category, student):
     193        """Get the payment dates of a student for the payment category
     194        specified.
     195        """
    187196        d = {}
    188197        d['p_item'] = u''
     
    211220
    212221    def getAccommodationDetails(self, student):
     222        """Determine the accommodation dates of a student.
     223        """
    213224        d = {}
    214225        d['error'] = u''
     
    238249        return d
    239250
    240     # In the standard configuration we select the first bed found,
    241     # but can also randomize the selection if we like.
    242251    def selectBed(self, available_beds):
     252        """Select a bed from a list of available beds.
     253
     254        In the base configuration we select the first bed found,
     255        but can also randomize the selection if we like.
     256        """
    243257        return available_beds[0]
    244258
    245259    def renderPDF(self, view, filename='slip.pdf',
    246260        student=None, studentview=None, tableheader=None, tabledata=None):
     261        """Render pdf slips for various pages.
     262        """
    247263        # (0,0),(-1,-1) = whole table
    248264        # (0,0),(0,-1) = first column
     
    361377        return pdf.getpdfdata()
    362378
    363     def getVerdictsDict(self):
    364         """Provide a dictionary of verdicts.
    365         """
    366         return {
    367             '0': 'not yet',
    368             'A': 'Successful student',
    369             'B': 'Student with carryover courses',
    370             'C': 'Student on probation',
    371             'D': 'Withdrawn from the faculty',
    372             'E': 'Student who were previously on probation',
    373             'F': 'Medical case',
    374             'G': 'Absent from examination',
    375             'H': 'Withheld results',
    376             'I': 'Expelled/rusticated/suspended student',
    377             'J': 'Temporary withdrawn from the university',
    378             'K': 'Unregistered student',
    379             'L': 'Referred student',
    380             'M': 'Reinstatement',
    381             'N': 'Student on transfer',
    382             'O': 'NCE-III repeater',
    383             'Y': 'No previous verdict',
    384             'X': 'New 300 level student',
    385             'Z': 'Successful student (provisional)',
    386             'A1': 'First Class',
    387             'A2': 'Second Class Upper',
    388             'A3': 'Second Class Lower',
    389             'A4': 'Third Class',
    390             'A5': 'Pass',
    391             'A6': 'Distinction',
    392             'A7': 'Credit',
    393             'A8': 'Merit',
    394             }
     379    VERDICTS_DICT = {
     380        '0': 'not yet',
     381        'A': 'Successful student',
     382        'B': 'Student with carryover courses',
     383        'C': 'Student on probation',
     384        'D': 'Withdrawn from the faculty',
     385        'E': 'Student who were previously on probation',
     386        'F': 'Medical case',
     387        'G': 'Absent from examination',
     388        'H': 'Withheld results',
     389        'I': 'Expelled/rusticated/suspended student',
     390        'J': 'Temporary withdrawn from the university',
     391        'K': 'Unregistered student',
     392        'L': 'Referred student',
     393        'M': 'Reinstatement',
     394        'N': 'Student on transfer',
     395        'O': 'NCE-III repeater',
     396        'Y': 'No previous verdict',
     397        'X': 'New 300 level student',
     398        'Z': 'Successful student (provisional)',
     399        'A1': 'First Class',
     400        'A2': 'Second Class Upper',
     401        'A3': 'Second Class Lower',
     402        'A4': 'Third Class',
     403        'A5': 'Pass',
     404        'A6': 'Distinction',
     405        'A7': 'Credit',
     406        'A8': 'Merit',
     407        }
Note: See TracChangeset for help on using the changeset viewer.