Changeset 8531 for main/waeup.fceokene/trunk/src/waeup
- Timestamp:
- 27 May 2012, 16:47:35 (12 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/applicants
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/applicant.py
r8460 r8531 22 22 from waeup.kofa.utils.helpers import attrs_to_fields 23 23 from waeup.fceokene.applicants.interfaces import( 24 ICustomApplicant, IUGApplicantEdit, IPGApplicantEdit )24 ICustomApplicant, IUGApplicantEdit, IPGApplicantEdit, IPUTMEApplicantEdit) 25 25 26 26 class CustomApplicant(Applicant): 27 27 28 grok.implements(ICustomApplicant, IUGApplicantEdit, IPGApplicantEdit) 28 grok.implements(ICustomApplicant, IUGApplicantEdit, 29 IPGApplicantEdit, IPUTMEApplicantEdit) 29 30 grok.provides(ICustomApplicant) 30 31 -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/browser.py
r8528 r8531 37 37 from waeup.fceokene.applicants.interfaces import ( 38 38 IPGApplicant, IUGApplicant, IPGApplicantEdit, IUGApplicantEdit, 39 ICustomApplicantOnlinePayment, 39 ICustomApplicantOnlinePayment, IPUTMEApplicantEdit, 40 40 UG_OMIT_DISPLAY_FIELDS, PG_OMIT_DISPLAY_FIELDS, 41 41 UG_OMIT_MANAGE_FIELDS, PG_OMIT_MANAGE_FIELDS, 42 UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS )42 UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS, PUTME_OMIT_EDIT_FIELDS) 43 43 from waeup.fceokene.interfaces import MessageFactory as _ 44 44 … … 124 124 for field in PG_OMIT_EDIT_FIELDS: 125 125 form_fields = form_fields.omit(field) 126 elif target is not None and target.startswith('putme'): 127 form_fields = grok.AutoFields(IPUTMEApplicantEdit) 128 for field in PUTME_OMIT_EDIT_FIELDS: 129 form_fields = form_fields.omit(field) 126 130 else: 127 131 form_fields = grok.AutoFields(IUGApplicantEdit) -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/interfaces.py
r8520 r8531 24 24 AppCatCertificateSource, CertificateSource) 25 25 from waeup.kofa.schoolgrades import ResultEntryField 26 from waeup.kofa.interfaces import SimpleKofaVocabulary, academic_sessions_vocab 27 from waeup.kofa.schema import FormattedDate 28 from waeup.kofa.students.vocabularies import nats_vocab 26 from waeup.kofa.interfaces import ( 27 SimpleKofaVocabulary, academic_sessions_vocab, validate_email) 28 from waeup.kofa.schema import FormattedDate, TextLineChoice 29 from waeup.kofa.students.vocabularies import nats_vocab, GenderSource 30 from waeup.kofa.applicants.interfaces import contextual_reg_num_source 29 31 from waeup.fceokene.interfaces import ( 30 32 LGASource, high_qual, high_grade, exam_types) … … 36 38 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 37 39 'student_id', 'screening_score', 'screening_venue') 40 PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + ( 41 'firstname', 'middlename', 'lastname', 'sex', 42 'course1', 'lga', 'jambscore') 38 43 39 44 PG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password') 40 45 PG_OMIT_MANAGE_FIELDS = () 41 PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 46 PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + ( 47 'locked', 'course_admitted', 42 48 'student_id', 'screening_score', 'screening_venue') 43 49 … … 60 66 required = False, 61 67 ) 62 63 # This ordering doesn't work properly. 64 IUGApplicant[ 65 'nationality'].order = IApplicantBaseData['sex'].order 66 IUGApplicant[ 67 'lga'].order = IUGApplicant['nationality'].order 68 68 perm_address = schema.Text( 69 title = _(u'Permanent Address'), 70 required = False, 71 ) 72 course1 = schema.Choice( 73 title = _(u'1st Choice Course of Study'), 74 source = AppCatCertificateSource(), 75 required = True, 76 ) 77 course2 = schema.Choice( 78 title = _(u'2nd Choice Course of Study'), 79 source = AppCatCertificateSource(), 80 required = False, 81 ) 82 jambscore = schema.Int( 83 title = _(u'JAMB Score'), 84 required = False, 85 ) 86 87 88 # More fields 89 90 91 notice = schema.Text( 92 title = _(u'Notice'), 93 required = False, 94 ) 95 screening_venue = schema.TextLine( 96 title = _(u'Screening Venue'), 97 required = False, 98 ) 99 screening_score = schema.Int( 100 title = _(u'Screening Score'), 101 required = False, 102 ) 103 student_id = schema.TextLine( 104 title = _(u'Student Id'), 105 required = False, 106 readonly = False, 107 ) 108 course_admitted = schema.Choice( 109 title = _(u'Admitted Course of Study'), 110 source = CertificateSource(), 111 required = False, 112 ) 113 locked = schema.Bool( 114 title = _(u'Form locked'), 115 default = False, 116 ) 69 117 70 118 class IPGApplicant(IApplicantBaseData): … … 227 275 readonly = False, 228 276 ) 277 student_id = schema.TextLine( 278 title = _(u'Student Id'), 279 required = False, 280 readonly = False, 281 ) 229 282 course_admitted = schema.Choice( 230 283 title = _(u'Admitted Course of Study'), … … 233 286 readonly = False, 234 287 ) 235 236 237 # This ordering doesn't work properly. 238 IPGApplicant[ 239 'nationality'].order = IApplicantBaseData['sex'].order 240 IPGApplicant[ 241 'lga'].order = IPGApplicant['nationality'].order 242 IPGApplicant[ 243 'student_id'].order = IPGApplicant['notice'].order 244 288 locked = schema.Bool( 289 title = _(u'Form locked'), 290 default = False, 291 ) 245 292 246 293 class ICustomApplicant(IUGApplicant,IPGApplicant): … … 286 333 287 334 """ 335 336 class IPUTMEApplicantEdit(IUGApplicant): 337 """An undergraduate applicant interface for editing. 338 339 Here we can repeat the fields from base data and set the 340 `required` and `readonly` attributes to True to further restrict 341 the data access. Or we can allow only certain certificates to be 342 selected by choosing the appropriate source. 343 344 We cannot omit fields here. This has to be done in the 345 respective form page. 346 """ 347 email = schema.ASCIILine( 348 title = _(u'Email Address'), 349 required = True, 350 constraint=validate_email, 351 ) 352 353 IPUTMEApplicantEdit[ 354 'email'].order = IUGApplicant['email'].order -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests.py
r8528 r8531 254 254 'emp_reason,emp_start,employer,employer2,firstname,history,' 255 255 'hq_degree,hq_disc,hq_matric_no,hq_school,hq_session,hq_type,' 256 ' lastname,lga,locked,middlename,nationality,notice,nysc_lga,'256 'jambscore,lastname,lga,locked,middlename,nationality,notice,nysc_lga,' 257 257 'nysc_year,password,perm_address,phone,pp_school,presently_inst,' 258 'reg_number,screening_score,screening_venue,sex,state,student_id' 258 'reg_number,screening_score,screening_venue,sex,state,student_id,' 259 'container_code' 259 260 in result) 260 261 self.assertTrue( 261 'Application initialized by system\'],,,,,,, Tester,,0,M.,,'262 'Application initialized by system\'],,,,,,,,Tester,,0,M.,,' 262 263 '"Some notice\nin lines.",,,any password,,+234-123-12345,,,' 263 '123456,98,Exam Room,f,initialized, ' in result)264 return 264 '123456,98,Exam Room,f,initialized,,dp2011' in result) 265 return -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/utils.py
r8528 r8531 53 53 'form.nysc_year': _(u'NYSC Information'), 54 54 'form.employer': _(u'Employment History'), 55 'form.jambscore': _(u'JAMB Data'), 55 56 'form.notice': _(u'Application Process Information'), 56 57 'form.pp_school': _(u'Post Primary School Qualification'),
Note: See TracChangeset for help on using the changeset viewer.