Ignore:
Timestamp:
26 Sep 2012, 14:59:20 (12 years ago)
Author:
Henrik Bettermann
Message:

Export number of tickets contained in a StudentStudyLevel? container.

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

Legend:

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

    r8971 r9235  
    176176    #: Fieldnames considered by this exporter
    177177    fields = tuple(sorted(iface_names(
    178         IStudentStudyLevel) + ['level'])) + ('student_id',)
     178        IStudentStudyLevel) + ['level'])) + ('student_id', 'number_of_tickets')
    179179
    180180    #: The title under which this exporter will be displayed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9217 r9235  
    428428    """
    429429    level = Attribute('The level code')
     430    number_of_tickets = Attribute('Number of tickets contained in this level')
    430431
    431432    level_session = schema.Choice(
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r9161 r9235  
    4545        except AttributeError:
    4646            return None
     47
     48    @property
     49    def number_of_tickets(self):
     50        return len(self)
    4751
    4852    def writeLogMessage(self, view, message):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9218 r9235  
    12911291                           self.browser.contents)
    12921292        self.browser.getControl("Create course list now").click()
     1293        # A level with one course ticket was created
     1294        self.assertEqual(self.student['studycourse']['100'].number_of_tickets, 1)
    12931295        self.browser.getLink("100").click()
    12941296        self.browser.getLink("Edit course list").click()
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r9161 r9235  
    210210            result,
    211211            'level,level_session,level_verdict,validated_by,validation_date,'
    212             'student_id\r\n'
    213             ',,0,,,\r\n'
     212            'student_id,number_of_tickets\r\n'
     213            ',,0,,,,0\r\n'
    214214            )
    215215        return
     
    227227            result,
    228228            'level,level_session,level_verdict,validated_by,validation_date,'
    229             'student_id\r\n'
    230             '100,2012,A,,,A111111\r\n'
     229            'student_id,number_of_tickets\r\n'
     230            '100,2012,A,,,A111111,1\r\n'
    231231            )
    232232        return
     
    242242            result,
    243243            'level,level_session,level_verdict,validated_by,validation_date,'
    244             'student_id\r\n'
    245             '100,2012,A,,,A111111\r\n'
     244            'student_id,number_of_tickets\r\n'
     245            '100,2012,A,,,A111111,1\r\n'
    246246            )
    247247        return
     
    256256            result,
    257257            'level,level_session,level_verdict,validated_by,validation_date,'
    258             'student_id\r\n'
    259             '100,2012,A,,,A111111\r\n'
     258            'student_id,number_of_tickets\r\n'
     259            '100,2012,A,,,A111111,1\r\n'
    260260            )
    261261        return
Note: See TracChangeset for help on using the changeset viewer.