Changeset 8377


Ignore:
Timestamp:
7 May 2012, 06:33:00 (13 years ago)
Author:
Henrik Bettermann
Message:

Export also container_code. This eases re-importing data.

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

Legend:

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

    r8375 r8377  
    5858
    5959    @property
     60    def container_code(self):
     61        return self.__parent__.code
     62
     63    @property
    6064    def translated_state(self):
    6165        return application_states_dict[self.state]
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py

    r8376 r8377  
    7171
    7272    #: Fieldnames considered by this exporter
    73     fields = tuple(sorted(IApplicantBaseData.names()))
     73    fields = tuple(sorted(IApplicantBaseData.names())) + ('container_code',)
    7474
    7575    #: The title under which this exporter will be displayed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r8376 r8377  
    144144            'history,lastname,locked,middlename,notice,password,phone,'
    145145            'reg_number,screening_score,screening_venue,sex,state,'
    146             'student_id\r\n'
     146            'student_id,container_code\r\n'
    147147            'dp2011_654321,,654321,,,,,Anna Tester,,Anna,'
    148148            in result)
    149149        self.assertTrue(
    150150            'Application initialized by system\'],Tester,'
    151             '0,,,,,,,,,initialized,\r\n'
     151            '0,,,,,,,,,initialized,,dp2011\r\n'
    152152            in result)
    153153        return
     
    168168            'history,lastname,locked,middlename,notice,password,phone,'
    169169            'reg_number,screening_score,screening_venue,sex,state,'
    170             'student_id\r\n'
     170            'student_id,container_code\r\n'
    171171            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
    172172            'Anna M. Tester,anna@sample.com,Anna,'
     
    175175            'Application initialized by system\'],'
    176176            'Tester,0,M.,"Some notice\nin lines.",any password,'
    177             '+234-123-12345,123456,98,Exam Room,f,initialized,\r\n'
     177            '+234-123-12345,123456,98,Exam Room,f,initialized,,dp2011\r\n'
    178178            in result)
    179179
     
    192192            'history,lastname,locked,middlename,notice,password,phone,'
    193193            'reg_number,screening_score,screening_venue,sex,state,'
    194             'student_id\r\n'
     194            'student_id,container_code\r\n'
    195195            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
    196196            'Anna M. Tester,anna@sample.com,Anna,'
     
    199199            'Application initialized by system\'],'
    200200            'Tester,0,M.,"Some notice\nin lines.",any password,'
    201             '+234-123-12345,123456,98,Exam Room,f,initialized,\r\n'
    202             in result)
    203         return
     201            '+234-123-12345,123456,98,Exam Room,f,initialized,,dp2011\r\n'
     202            in result)
     203        return
Note: See TracChangeset for help on using the changeset viewer.