Ignore:
Timestamp:
30 Nov 2017, 07:39:20 (7 years ago)
Author:
Henrik Bettermann
Message:

Replace gpa_boundaries utility attribute by GPABoundaries method
which may return different values in custom packages depending on faculty
or department code (requested by AAU Ekpoma).

File:
1 edited

Legend:

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

    r14625 r14914  
    107107        students_utils = getUtility(IStudentsUtils)
    108108        table = list()
    109         for i in range(len(students_utils.gpa_boundaries)+1):
     109        for i in range(len(students_utils.GPABoundaries())+1):
    110110            # The last list is reserved for students with more than one
    111111            # level in the same session.
     
    137137                if itemcount > 1:
    138138                    # Error: more than one level registered in this session
    139                     table[len(students_utils.gpa_boundaries)].append(line)
     139                    table[len(students_utils.GPABoundaries())].append(line)
    140140                    continue
    141141            gpaclass = students_utils.getDegreeClassNumber(level_obj)
    142142            table[gpaclass].append(line)
    143             for i in range(len(students_utils.gpa_boundaries)+1):
     143            for i in range(len(students_utils.GPABoundaries())+1):
    144144                if len(table[i]):
    145145                    table[i] = sorted([value for value in table[i]],
     
    211211        students_utils = getUtility(IStudentsUtils)
    212212        # Print classes in reverse order
    213         for gpa_class in range(len(students_utils.gpa_boundaries)-1,-1,-1):
     213        for gpa_class in range(len(students_utils.GPABoundaries())-1,-1,-1):
    214214            pdf_data.append(Spacer(1, 20))
    215             gpa_class_name = students_utils.gpa_boundaries[gpa_class][1]
     215            gpa_class_name = students_utils.GPABoundaries(
     216                faccode=self.faccode, depcode=self.depcode)[gpa_class][1]
    216217            pdf_data += [Paragraph('<strong>%s</strong>' % gpa_class_name,
    217218                         STYLE["Normal"])]
     
    238239        total_count = 0
    239240        table_data = list()
    240         for gpa_class in range(len(students_utils.gpa_boundaries)-1,-1,-1):
    241             gpa_class_name = students_utils.gpa_boundaries[gpa_class][1]
     241        for gpa_class in range(len(students_utils.GPABoundaries())-1,-1,-1):
     242            gpa_class_name = students_utils.GPABoundaries(
     243                faccode=self.faccode, depcode=self.depcode)[gpa_class][1]
    242244            gpa_count = len(self.data[gpa_class])
    243245            total_count += gpa_count
Note: See TracChangeset for help on using the changeset viewer.