Ignore:
Timestamp:
26 Jan 2017, 07:42:39 (8 years ago)
Author:
Henrik Bettermann
Message:

Determine the class of degree which may depend on student parameters in custom packages.

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

Legend:

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

    r14051 r14461  
    831831        )
    832832
    833     late_registration_fee = schema.Float(
    834         title = _(u'Late Course Reg. Fee'),
    835         default = 0.0,
    836         required = False,
    837         )
    838 
    839833    clearance_fee = schema.Float(
    840834        title = _(u'Acceptance Fee'),
     
    851845    maint_fee = schema.Float(
    852846        title = _(u'Rent (fallback)'),
     847        default = 0.0,
     848        required = False,
     849        )
     850
     851    late_registration_fee = schema.Float(
     852        title = _(u'Late Course Reg. Fee'),
    853853        default = 0.0,
    854854        required = False,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r14410 r14461  
    821821                      (5, '1st Class'))
    822822
    823     def getClassFromCGPA(self, gpa):
     823    def getClassFromCGPA(self, gpa, student):
     824        """Determine the class of degree. In some custom packages
     825        this class depends on e.g. the entry session of the student. In the
     826        base package, it does not.
     827        """
    824828        if gpa < self.gpa_boundaries[0][0]:
    825829            return 0, self.gpa_boundaries[0][1]
     
    843847            # No credits weighted
    844848            return 6
    845         return self.getClassFromCGPA(level_obj.cumulative_params[0])[0]
     849        return self.getClassFromCGPA(
     850            level_obj.cumulative_params[0], level_obj.student)[0]
    846851
    847852    def renderPDFTranscript(self, view, filename='transcript.pdf',
     
    924929        f_label = Paragraph(f_label, ENTRY1_STYLE)
    925930        f_text = formatted_text('%.3f (%s)' % (
    926             transcript_data[1], self.getClassFromCGPA(transcript_data[1])[1]))
     931            transcript_data[1], self.getClassFromCGPA(
     932                transcript_data[1], student)[1]))
    927933        f_text = Paragraph(f_text, ENTRY1_STYLE)
    928934        contextdata.append([f_label,f_text])
Note: See TracChangeset for help on using the changeset viewer.