Changeset 13155 for main


Ignore:
Timestamp:
7 Jul 2015, 20:53:37 (9 years ago)
Author:
Henrik Bettermann
Message:

Add description only on edit page.

Use '++' separator when exporting jamb_subjects lines.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/browser.py

    r13142 r13155  
    225225                form_fields = form_fields.omit(field)
    226226        elif self.target is not None and self.target.startswith('pre'):
    227             form_fields = grok.AutoFields(INigeriaPGApplicant)
     227            form_fields = grok.AutoFields(INigeriaPGApplicantEdit)
    228228            for field in PG_OMIT_EDIT_FIELDS:
    229229                form_fields = form_fields.omit(field)
    230230        elif self.target is not None and self.target.startswith('cbt'):
    231             form_fields = grok.AutoFields(INigeriaUGApplicant)
     231            form_fields = grok.AutoFields(INigeriaUGApplicantEdit)
    232232            for field in CBT_OMIT_EDIT_FIELDS:
    233233                form_fields = form_fields.omit(field)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/export.py

    r13092 r13155  
    3737
    3838    def mangle_value(self, value, name, context=None):
     39        if name == 'jamb_subjects' and value:
     40            value = value.replace('\n', '++')
    3941        if '_result' in name and value:
    4042            value = [eval(entry.to_string()) for entry in value]
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/interfaces.py

    r13154 r13155  
    185185    jamb_subjects = schema.Text(
    186186        title = _(u'Subjects and Scores'),
    187         description = _(u'(Enter all four subjects, one subject with score per line!)'),
    188187        required = False,
    189188        )
     
    523522        show_year = True,
    524523        )
     524    jamb_subjects = schema.Text(
     525        title = _(u'Subjects and Scores'),
     526        description = _(u'Enter all four subjects, one subject with score per line!'),
     527        required = True,
     528        )
    525529
    526530INigeriaUGApplicantEdit[
    527     'date_of_birth'].order =  INigeriaUGApplicant['date_of_birth'].order
     531    'date_of_birth'].order = INigeriaUGApplicant['date_of_birth'].order
    528532INigeriaUGApplicantEdit[
    529     'email'].order =  INigeriaUGApplicant['email'].order
     533    'email'].order = INigeriaUGApplicant['email'].order
     534INigeriaUGApplicantEdit[
     535    'jamb_subjects'].order = INigeriaUGApplicant['jamb_subjects'].order
    530536
    531537class INigeriaPGApplicantEdit(INigeriaPGApplicant):
     
    559565class INigeriaApplicantOnlinePayment(INigeriaOnlinePayment):
    560566    """An applicant payment via payment gateways.
    561 
    562567    """
    563568
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/tests/test_browser.py

    r13142 r13155  
    347347        applicant.course_admitted = self.certificate
    348348        applicant.notice = u'Some notice\nin lines.'
     349        applicant.jamb_subjects = u'Line 1\nLine 2'
    349350        applicant.screening_score = 98
    350351        applicant.screening_venue = u'Exam Room'
     
    378379            'Anna M. Tester,anna@sample.com,,,,,,,,,,,Anna,,,,,,'
    379380            '[u\'2015-07-06 11:21:22 WAT - Application initialized by system\']'
    380             ',,,,,,,,,,Tester,,0,M.,NG,"Some notice\nin lines.",,,'
     381            ',,,,,,,,,Line 1++Line 2,Tester,,0,M.,NG,"Some notice\nin lines.",,,'
    381382            'any password,+234-123-12345#,,123456,,,,,,,'
    382383            '"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,,,'
Note: See TracChangeset for help on using the changeset viewer.