Changeset 9932


Ignore:
Timestamp:
4 Feb 2013, 07:15:04 (12 years ago)
Author:
Henrik Bettermann
Message:

Let's convert the 'sex' field values to lower case. This is one of the most common mistakes.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data.csv

    r9296 r9932  
    11student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,state
    2 X666666,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,m,courses validated
     2X666666,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,M,courses validated
    33Y777777,Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234,m,courses validated
    4 ,Susann,Berson,3,1990-01-04,100002,aa@aa.ng,1234,f,courses validated
     4,Susann,Berson,3,1990-01-04,100002,aa@aa.ng,1234,F,courses validated
    55,Else,Mueller,4,1990-01-05,100003,aa@aa.ng,1234,f,school fee paid
    66X888888,Alfons,Meier,5,1990-01-02,100004,aa@aa.ng,1234,m,courses validated
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.py

    r8335 r9932  
    118118    def request_data(self, name, value, schema_field, prefix='',
    119119                     mode='create'):
     120        if prefix == 'form.sex' and isinstance(value, basestring):
     121            value = value.lower()
    120122        return {prefix: value}
    121123
Note: See TracChangeset for help on using the changeset viewer.