Changeset 8072 for main/waeup.custom/trunk/src
- Timestamp:
- 9 Apr 2012, 07:53:53 (13 years ago)
- Location:
- main/waeup.custom/trunk/src/waeup/custom
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.custom/trunk/src/waeup/custom/applicants/interfaces.py
r8054 r8072 21 21 from zope import schema 22 22 from waeup.kofa.applicants.interfaces import IApplicantBaseData 23 from waeup.kofa.students.vocabularies import nats_vocab 24 from waeup.custom.interfaces import lgas_vocab 23 25 from waeup.custom.interfaces import MessageFactory as _ 24 26 … … 28 30 """ 29 31 32 nationality = schema.Choice( 33 source = nats_vocab, 34 title = _(u'Nationality'), 35 required = False, 36 ) 37 lga = schema.Choice( 38 source = lgas_vocab, 39 title = _(u'State/LGA (Nigerians only)'), 40 required = False, 41 ) 42 43 # This ordering doesn't work properly. 44 IUGApplicant[ 45 'nationality'].order = IApplicantBaseData['sex'].order 46 IUGApplicant[ 47 'lga'].order = IUGApplicant['nationality'].order 48 30 49 class IPGApplicant(IApplicantBaseData): 31 50 """A postgraduate applicant. … … 33 52 """ 34 53 54 nationality = schema.Choice( 55 source = nats_vocab, 56 title = _(u'Nationality'), 57 required = False, 58 ) 59 lga = schema.Choice( 60 source = lgas_vocab, 61 title = _(u'State/LGA (Nigerians only)'), 62 required = False, 63 ) 35 64 employer = schema.TextLine( 36 65 title = _(u'Employer'), … … 38 67 readonly = False, 39 68 ) 69 70 # This ordering doesn't work properly. 71 IPGApplicant[ 72 'nationality'].order = IApplicantBaseData['sex'].order 73 IPGApplicant[ 74 'lga'].order = IPGApplicant['nationality'].order 75 IPGApplicant[ 76 'student_id'].order = IPGApplicant['notice'].order 40 77 41 78 class IApplicant(IUGApplicant,IPGApplicant): -
main/waeup.custom/trunk/src/waeup/custom/applicants/tests.py
r8055 r8072 196 196 'applicant_id,application_date,application_number,course1,course2,' 197 197 'course_admitted,date_of_birth,display_fullname,email,employer,' 198 'firstname,history,lastname,lga,locked,middlename,n otice,password,'199 ' phone,reg_number,screening_score,screening_venue,sex,state,'200 's tudent_id'198 'firstname,history,lastname,lga,locked,middlename,nationality,' 199 'notice,password,phone,reg_number,screening_score,screening_venue,' 200 'sex,state,student_id' 201 201 in result) 202 202 self.assertTrue( 203 'Application initialized by system\'],Tester, foreigner,0,M.,'203 'Application initialized by system\'],Tester,,0,M.,,' 204 204 '"Some notice\nin lines.",any password,+234-123-12345,123456,98,' 205 205 'Exam Room,f,initialized,' in result) -
main/waeup.custom/trunk/src/waeup/custom/interfaces.py
r7928 r8072 19 19 import zope.i18nmessageid 20 20 from zope import schema 21 from waeup.kofa.interfaces import ( 21 from waeup.kofa.interfaces import (SimpleKofaVocabulary, 22 22 ISessionConfiguration, academic_sessions_vocab) 23 from waeup.custom.utils.lgas import LGAS 23 24 24 25 _ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.custom') 26 27 lgas_vocab = SimpleKofaVocabulary( 28 *sorted([(x[1],x[0]) for x in LGAS])) 25 29 26 30 # It's recommended to replicate all fields from the base package here. -
main/waeup.custom/trunk/src/waeup/custom/students/interfaces.py
r7995 r8072 19 19 from waeup.kofa.schema import TextLineChoice 20 20 from waeup.kofa.interfaces import SimpleKofaVocabulary 21 from waeup.kofa.students.vocabularies import nats_vocab 21 22 from waeup.kofa.students.interfaces import ( 22 23 IStudentBase,IUGStudentClearance,IPGStudentClearance, … … 24 25 ) 25 26 from waeup.kofa.students.vocabularies import ( 26 lgas_vocab, nats_vocab, contextual_reg_num_source) 27 nats_vocab, contextual_reg_num_source) 28 from waeup.custom.interfaces import lgas_vocab 29 from waeup.custom.interfaces import MessageFactory as _ 27 30 28 31 class IStudentBase(IStudentBase): … … 32 35 33 36 reg_number = TextLineChoice( 34 title = u'Registration Number',37 title = _(u'Registration Number'), 35 38 required = False, 36 39 readonly = False, … … 48 51 required = False, 49 52 vocabulary = SimpleKofaVocabulary( 50 ( 'Unmarried', 'unmarried'),51 ( 'Married', 'married'),)53 (_('Unmarried'), 'unmarried'), 54 (_('Married'), 'married'),) 52 55 ) 53 56 … … 57 60 """ 58 61 date_of_birth = schema.Date( 59 title = u'Date of Birth',62 title = _(u'Date of Birth'), 60 63 required = False, 61 64 ) … … 63 66 nationality = schema.Choice( 64 67 source = nats_vocab, 65 title = u'Nationality', 66 default = 'nigeria', 68 title = _(u'Nationality'), 67 69 required = False, 68 70 ) … … 70 72 lga = schema.Choice( 71 73 source = lgas_vocab, 72 title = u'State/LGA',74 title = _(u'State/LGA (Nigerians only)'), 73 75 required = False, 74 76 )
Note: See TracChangeset for help on using the changeset viewer.