Ignore:
Timestamp:
3 Sep 2026, 06:53:28 (3 months ago)
Author:
Henrik Bettermann
Message:

Add sex column.
Change signature.

Location:
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py

    r18313 r18323  
    548548Name: ___________________________________
    549549
    550 Senior Deputy Registrar
    551 (Examinations & Record)
    552 For: Registrar
     550Head Examinations and Records
    553551
    554552
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/reports/level_report.py

    r18321 r18323  
    4141    ILevelReport, LevelReportGeneratorPage,
    4242    LevelReportPDFView,
    43     TABLE_STYLE,
    4443    TTR)
    4544
    4645STYLE = getSampleStyleSheet()
     46
     47
     48TABLE_STYLE = [
     49    ('FONT', (0,0), (-1,-1), 'Helvetica', 8),
     50    ('VALIGN', (0, 1), (-1,-1), 'TOP'),
     51    #('FONT', (0,0), (0,-1), 'Helvetica-Bold', 8), # 1st column
     52    ('FONT', (0,0), (-1,0), 'Helvetica-Bold', 8), # 1st row
     53    #('FONT', (0,-1), (-1,-1), 'Helvetica-Bold', 8), # last row
     54    #('FONT', (-1,0), (-1,-1), 'Helvetica-Bold', 8), # last column
     55    ('ALIGN', (3,1), (-1,-1), 'RIGHT'),
     56    ('ALIGN', (0,0), (0,-1), 'RIGHT'),
     57    ('ALIGN', (7,0), (7,-1), 'LEFT'),
     58    ('ALIGN', (8,0), (8,-1), 'LEFT'),
     59    ('INNERGRID', (0,1), (-1,-1), 0.25, colors.black),
     60    ('BOX', (0,1), (-1,-1), 1, colors.black),
     61    ]
    4762
    4863def tbl_data_to_table(data):
    … …  
    5267            'Matric No.',
    5368            'Student Name',
     69            'Sex',
    5470            TTR('Total Credits Taken'),
    5571            TTR('Total Credits Passed'),
    … …  
    134150            not_taken_courses = textwrap.fill(passed_params[5], 17)
    135151            fullname = textwrap.fill(stud.display_fullname, 29)
     152            sex = stud.sex
    136153            remark = getattr(level_obj, 'remark', '')
    137154            cert = stud['studycourse'].certificate
    … …  
    165182                    stud.matric_number,
    166183                    fullname,
     184                    sex,
    167185                    credits_counted,
    168186                    credits_passed,
    … …  
    179197        return sorted(table, key=lambda value:value[0])
    180198
     199    note = """
     200
     201
     202
     203  FRNS (Faculty Requirements Not Satisfied)
     204  NER (No Evidence of Registration)
     205  NEV (No Evidence of Verification)
     206    """
     207
    181208    def create_pdf(self, job_id):
    182209        creator = getUtility(IPDFCreator, name=self.pdfcreator)
    183210        table_data = tbl_data_to_table(self.data)
    184211        #col_widths = [3.5*cm] * len(self.data[0])
    185         col_widths = [1*cm, 4*cm, 5*cm, 0.8*cm, 0.8*cm, 1*cm,
    186                       5.2*cm, 3*cm, 0.8*cm, 0.8*cm, 0.8*cm, 1*cm, 2*cm]
     212        col_widths = [0.8*cm, 3*cm, 5*cm, 0.8*cm, 0.8*cm, 0.8*cm, 1*cm,
     213                      4*cm, 4*cm, 0.8*cm, 0.8*cm, 0.8*cm, 1*cm, 2*cm]
    187214        pdf_data = [Paragraph('<b>%s - Report %s</b>'
    188215                              % (self.creation_dt_string, job_id),
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/reports/tests/test_level_report.py

    r18317 r18323  
    3030    def test_get_students(self):
    3131        self.student['studycourse']['100']['Course1'].ca = 0
     32        self.student.sex = 'm'
    3233        lr =  GradLevelReport('fac1', 'dep1', 'CERT1', 2010, 100)
    3334        # this is not a graduating student
    … …  
    4142        result = lr._get_students('fac1', 'dep1', 'CERT1', 2010, 100)
    4243        self.assertEqual(result,
    43             [(u'1234', u'TESTER, Bob', 91, 91, '5.00',
     44            [(u'1234', u'TESTER, Bob', 'm', 91, 91, '5.00',
    4445               'Nil', 'Nil', 91, 91, 77,'5.00', '1s_st_s')])
    4546        return
    … …  
    4849        self.student['studycourse']['100']['Course1'].ca = 0
    4950        self.student['studycourse']['100']['Course1'].credits = 146
     51        self.student.sex = 'm'
    5052        self.certificate.end_level = 100
    5153        self.certificate.custom_float_1 = 145.6
    … …  
    6365        self.student['studycourse']['100']['Course1'].ca = 0
    6466        self.student['studycourse']['100']['Course1'].credits = 91
     67        self.student.sex = 'm'
    6568        self.certificate.end_level = 100
    6669        self.certificate.custom_float_1 = 77
    … …  
    7982        self.student['studycourse']['100']['Course1'].ca = 0
    8083        self.student['studycourse']['100']['Course1'].credits = 91
     84        self.student.sex = 'm'
    8185        self.certificate.end_level = 100
    8286        self.certificate.custom_float_1 = 77
Note: See TracChangeset for help on using the changeset viewer.