Changeset 11484


Ignore:
Timestamp:
12 Mar 2014, 22:14:18 (11 years ago)
Author:
Henrik Bettermann
Message:

Add display_fullname column to CourseTicketExporter? (requested by Uniben).

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r11483 r11484  
    441.0.1dev (unreleased)
    55=====================
     6
     7* Add display_fullname column to CourseTicketExporter (requested by Uniben).
    68
    79* Do also export student and course ticket data of students on probation.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r11483 r11484  
    275275    #: Fieldnames considered by this exporter
    276276    fields = tuple(sorted(iface_names(ICourseTicket) +
    277         ['level', 'code', 'level_session'])) + ('student_id', 'certcode')
     277        ['level', 'code', 'level_session'])) + ('student_id',
     278        'certcode', 'display_fullname')
    278279
    279280    #: The title under which this exporter will be displayed
     
    288289        if context is not None:
    289290            student = context.student
    290             if name == 'student_id' and student is not None:
     291            if name in ('student_id', 'display_fullname') and student is not None:
    291292                value = getattr(student, name, None)
    292             if name == 'level':
    293                 value = getattr(context, 'level', lambda: None)
    294             if name == 'level_session':
    295                 value = getattr(context, 'level_session', lambda: None)
     293            #if name == 'level':
     294            #    value = getattr(context, 'level', lambda: None)
     295            #if name == 'level_session':
     296            #    value = getattr(context, 'level_session', lambda: None)
    296297        return super(
    297298            CourseTicketExporter, self).mangle_value(
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r11483 r11484  
    525525            result,
    526526            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    527             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
    528             '0,0,,,,,,,0,,,,,,\r\n'
     527            'mandatory,passmark,score,semester,title,student_id,certcode,'
     528            'display_fullname\r\n'
     529            '0,0,,,,,,,0,,,,,,,\r\n'
    529530            )
    530531        return
     
    543544            result,
    544545            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    545             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
    546             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1\r\n'
     546            'mandatory,passmark,score,semester,title,student_id,certcode,'
     547            'display_fullname\r\n'
     548            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     549            'Anna M. Tester\r\n'
    547550            )
    548551        return
     
    558561            result,
    559562            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    560             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
    561             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1\r\n'
     563            'mandatory,passmark,score,semester,title,student_id,certcode,'
     564            'display_fullname\r\n'
     565            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     566            'Anna M. Tester\r\n'
    562567            )
    563568        return
     
    572577            result,
    573578            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    574             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
    575             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1\r\n'
     579            'mandatory,passmark,score,semester,title,student_id,certcode,'
     580            'display_fullname\r\n'
     581            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     582            'Anna M. Tester\r\n'
    576583            )
    577584        return
     
    590597            result,
    591598            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    592             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
    593             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1\r\n'
     599            'mandatory,passmark,score,semester,title,student_id,certcode,'
     600            'display_fullname\r\n'
     601            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     602            'Anna M. Tester\r\n'
    594603            )
    595604        # if the coursetickets catalog is used to filter students
     
    602611            result,
    603612            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    604             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
    605             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1\r\n'
     613            'mandatory,passmark,score,semester,title,student_id,certcode,'
     614            'display_fullname\r\n'
     615            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     616            'Anna M. Tester\r\n'
    606617            )
    607618        exporter.export_filtered(
     
    611622            result,
    612623            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    613             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
     624            'mandatory,passmark,score,semester,title,student_id,certcode,'
     625            'display_fullname\r\n'
    614626            )
    615627        # Also tickets in probating levels are exported. Therefore
     
    623635            result,
    624636            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    625             'mandatory,passmark,score,semester,title,student_id,certcode\r\n'
    626             '1,1,CRS1,100,DEP1,FAC1,110,2012,0,100,,2,Course 1,A111111,CERT1\r\n'
     637            'mandatory,passmark,score,semester,title,student_id,certcode,'
     638            'display_fullname\r\n'
     639            '1,1,CRS1,100,DEP1,FAC1,110,2012,0,100,,2,Course 1,A111111,CERT1,'
     640            'Anna M. Tester\r\n'
    627641            )
    628642        return
Note: See TracChangeset for help on using the changeset viewer.