Changeset 7515


Ignore:
Timestamp:
26 Jan 2012, 08:59:05 (13 years ago)
Author:
Henrik Bettermann
Message:

In import files we can use the hash symbol at the end of a date string to
avoid annoying automatic date transformation by Excel or Calc.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data_migration.csv

    r7513 r7515  
    11student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password,reg_state
    2 A123456,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,mypw1,school fee paid
     2A123456,Aaren,Pieri,1,1990-01-02#,100000,aa@aa.ng,1234,mypw1,school fee paid
    33B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypw1,cleared
    44C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,mypw1,admitted
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py

    r7513 r7515  
    2222import tempfile
    2323import unittest
     24import datetime
    2425from zope.component import createObject
    2526from zope.component.hooks import setSite, clearSite
     
    200201        self.assertTrue('A123456' in self.app['students'].keys())
    201202        self.assertEqual(self.app['students']['A123456'].state,'school fee paid')
     203        self.assertEqual(self.app['students']['A123456'].date_of_birth,
     204            datetime.date(1990, 1, 2))
     205        self.assertEqual(self.app['students']['B123456'].state,'cleared')
     206        self.assertEqual(self.app['students']['B123456'].date_of_birth,
     207            datetime.date(1990, 1, 3))
    202208        shutil.rmtree(os.path.dirname(fin_file))
    203209
  • main/waeup.sirp/trunk/src/waeup/sirp/widgets/datewidget.py

    r7196 r7515  
    3939        else:
    4040            try:
     41                # In import files we can use the hash symbol at the end of a
     42                # date string to avoid annoying automatic date transformation
     43                # by Excel or Calc
     44                input = input.strip('#')
    4145                value = datetime.strptime(input, self.date_format)
    4246            except (ValueError, IndexError), v:
Note: See TracChangeset for help on using the changeset viewer.