Changeset 7973
- Timestamp:
- 23 Mar 2012, 08:15:58 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r7944 r7973 22 22 title = _(u'Students') 23 23 24 def mangle_value(self, value, name, context=None): 25 """Add the hash symbol at the end of date_of_birth. 26 27 This is to avoid annoying automatic date transformation 28 by Excel or Calc. 29 """ 30 if name == 'date_of_birth': 31 value = str(value) + '#' 32 return super( 33 StudentsExporter, self).mangle_value( 34 value, name, context=context) 35 24 36 def export(self, students, filepath=None): 25 37 """Export `students`, an iterable, as CSV file. -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r7946 r7973 70 70 'perm_address,phone,reg_number,sex,student_id\r\n' 71 71 72 'my adm code,0,my clr code,1981-02-04 ,anna@sample.com,Anna,'72 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,Anna,' 73 73 'Tester,M123456,M.,nigeria,"Studentroad 21\nLagos 123456\n",' 74 74 '+234-123-12345,123456,f,A111111\r\n' … … 89 89 'perm_address,phone,reg_number,sex,student_id\r\n' 90 90 91 'my adm code,0,my clr code,1981-02-04 ,anna@sample.com,Anna,'91 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,Anna,' 92 92 'Tester,M123456,M.,nigeria,"Studentroad 21\nLagos 123456\n",' 93 93 '+234-123-12345,123456,f,A111111\r\n'
Note: See TracChangeset for help on using the changeset viewer.