Changeset 8376


Ignore:
Timestamp:
7 May 2012, 05:57:46 (13 years ago)
Author:
Henrik Bettermann
Message:

Add the hash symbol at the end of all dates.
This is to avoid annoying automatic date transformation
by Excel or Calc.

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

Legend:

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

    r8311 r8376  
    7777
    7878    def mangle_value(self, value, name, context=None):
     79        # Add the hash symbol at the end of dates.
     80        # This is to avoid annoying automatic date transformation
     81        # by Excel or Calc.
     82        if name in ('date_of_birth', 'emp_start', 'emp_end',
     83            'emp2_start', 'emp2_end') and value is not None:
     84            value = str(value) + '#'
    7985        if name in (
    8086            'course1', 'course2', 'course_admitted') and value is not None:
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r8311 r8376  
    169169            'reg_number,screening_score,screening_venue,sex,state,'
    170170            'student_id\r\n'
    171             'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'
     171            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
    172172            'Anna M. Tester,anna@sample.com,Anna,'
    173173            in result)
     
    193193            'reg_number,screening_score,screening_venue,sex,state,'
    194194            'student_id\r\n'
    195             'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'
     195            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
    196196            'Anna M. Tester,anna@sample.com,Anna,'
    197197            in result)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r8371 r8376  
    4747        by Excel or Calc.
    4848        """
    49         if name == 'date_of_birth':
     49        if name == 'date_of_birth' and value is not None:
    5050            value = str(value) + '#'
    5151        return super(
Note: See TracChangeset for help on using the changeset viewer.