Changeset 9049 for main/kofacustom.nigeria/trunk/src/kofacustom
- Timestamp:
- 25 Jul 2012, 21:57:47 (12 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/browser.py
r8926 r9049 38 38 INigeriaPGApplicant, INigeriaUGApplicant, 39 39 INigeriaPGApplicantEdit, INigeriaUGApplicantEdit, 40 INigeriaApplicantOnlinePayment, 41 UG_OMIT_DISPLAY_FIELDS, P G_OMIT_DISPLAY_FIELDS,42 UG_OMIT_PDF_FIELDS, P G_OMIT_PDF_FIELDS,43 UG_OMIT_MANAGE_FIELDS, P G_OMIT_MANAGE_FIELDS,40 INigeriaApplicantOnlinePayment,IPUTMEApplicantEdit, 41 UG_OMIT_DISPLAY_FIELDS, PUTME_OMIT_DISPLAY_FIELDS, PG_OMIT_DISPLAY_FIELDS, 42 UG_OMIT_PDF_FIELDS, PUTME_OMIT_PDF_FIELDS, PG_OMIT_PDF_FIELDS, 43 UG_OMIT_MANAGE_FIELDS, PUTME_OMIT_MANAGE_FIELDS, PG_OMIT_MANAGE_FIELDS, 44 44 UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS, PUTME_OMIT_EDIT_FIELDS, 45 UG_OMIT_RESULT_SLIP_FIELDS)45 PUTME_OMIT_RESULT_SLIP_FIELDS) 46 46 from kofacustom.nigeria.interfaces import MessageFactory as _ 47 47 … … 85 85 for field in PG_OMIT_PDF_FIELDS: 86 86 form_fields = form_fields.omit(field) 87 elif target is not None and target.startswith('putme'): 88 form_fields = grok.AutoFields(INigeriaUGApplicant) 89 if self._reduced_slip(): 90 for field in PUTME_OMIT_RESULT_SLIP_FIELDS: 91 form_fields = form_fields.omit(field) 92 else: 93 for field in PUTME_OMIT_PDF_FIELDS: 94 form_fields = form_fields.omit(field) 87 95 else: 88 96 form_fields = grok.AutoFields(INigeriaUGApplicant) 89 if self._reduced_slip(): 90 for field in UG_OMIT_RESULT_SLIP_FIELDS: 91 form_fields = form_fields.omit(field) 92 else: 93 for field in UG_OMIT_PDF_FIELDS: 94 form_fields = form_fields.omit(field) 97 for field in UG_OMIT_PDF_FIELDS: 98 form_fields = form_fields.omit(field) 95 99 if not getattr(self.context, 'student_id'): 96 100 form_fields = form_fields.omit('student_id') … … 107 111 form_fields = grok.AutoFields(INigeriaPGApplicant) 108 112 for field in PG_OMIT_DISPLAY_FIELDS: 113 form_fields = form_fields.omit(field) 114 elif target is not None and target.startswith('putme'): 115 form_fields = grok.AutoFields(INigeriaUGApplicant) 116 for field in PUTME_OMIT_DISPLAY_FIELDS: 109 117 form_fields = form_fields.omit(field) 110 118 else: … … 124 132 form_fields = grok.AutoFields(INigeriaPGApplicant) 125 133 for field in PG_OMIT_MANAGE_FIELDS: 134 form_fields = form_fields.omit(field) 135 elif target is not None and target.startswith('putme'): 136 form_fields = grok.AutoFields(INigeriaUGApplicant) 137 for field in PUTME_OMIT_MANAGE_FIELDS: 126 138 form_fields = form_fields.omit(field) 127 139 else: -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/interfaces.py
r9045 r9049 21 21 from zope import schema 22 22 from waeup.kofa.applicants.interfaces import ( 23 contextual_reg_num_source, 23 24 IApplicantBaseData, 24 25 AppCatCertificateSource, CertificateSource) … … 28 29 from waeup.kofa.schema import FormattedDate, TextLineChoice 29 30 from waeup.kofa.students.vocabularies import nats_vocab, GenderSource 30 from waeup.kofa.applicants.interfaces import contextual_reg_num_source31 31 from kofacustom.nigeria.interfaces import ( 32 32 LGASource, high_qual, high_grade, exam_types) … … 34 34 from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment 35 35 36 UG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 37 'password', 'result_uploaded', 'suspended') 36 # Fields to be omitted in all display forms. course_admitted is 37 # rendered seperately. 38 39 OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 40 'result_uploaded', 'suspended') 41 42 # UG students are all undergraduate students. 43 UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS 38 44 UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone') 39 45 UG_OMIT_MANAGE_FIELDS = () 40 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 41 'student_id', 'screening_score', 'screening_venue', 'notice', 42 'screening_date', 'result_uploaded', 'suspended', 43 'jamb_subjects', 'jamb_score', 'aggregate') 44 PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + ( 46 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + ( 47 'student_id', 'notice', 48 'screening_score', 'screening_venue', 49 'screening_date', 'jamb_subjects', 50 'jamb_score', 'aggregate') 51 52 # PUTME is a subgroup of UG with the same interface. 53 PUTME_OMIT_FIELDS = ( 54 'hq_type', 'hq_matric_no', 55 'hq_degree', 'hq_school', 56 'hq_session', 'hq_disc',) 57 PUTME_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUTME_OMIT_FIELDS 58 PUTME_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUTME_OMIT_FIELDS 59 PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + PUTME_OMIT_FIELDS + ( 45 60 'firstname', 'middlename', 'lastname', 'sex', 46 61 'course1', 'lga') 47 UG_OMIT_RESULT_SLIP_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone', 62 PUTME_OMIT_PDF_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + ('email', 'phone') 63 PUTME_OMIT_RESULT_SLIP_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + ( 64 'email', 'phone', 48 65 'date_of_birth', 'sex', 49 'nationality', 'lga', 'perm_address', 'course2', 'screening_venue', 66 'nationality', 'lga', 'perm_address', 67 'course2', 'screening_venue', 50 68 'screening_date') 51 69 52 PG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password', 'suspended') 53 PG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone') 70 # PG has its own interface 71 PG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS 72 PG_OMIT_PDF_FIELDS = PG_OMIT_DISPLAY_FIELDS + ('email', 'phone') 54 73 PG_OMIT_MANAGE_FIELDS = () 55 74 PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + ( 56 'locked', 'course_admitted', 'suspended', 57 'student_id', 'screening_score', 'screening_venue', 'notice', 58 'screening_date') 75 'student_id', 'notice') 59 76 60 77 class INigeriaUGApplicant(IApplicantBaseData): … … 90 107 required = False, 91 108 ) 109 hq_type = schema.Choice( 110 title = _(u'Qualification Obtained'), 111 required = False, 112 readonly = False, 113 vocabulary = high_qual, 114 ) 115 hq_matric_no = schema.TextLine( 116 title = _(u'Former Matric Number'), 117 required = False, 118 readonly = False, 119 ) 120 hq_degree = schema.Choice( 121 title = _(u'Class of Degree'), 122 required = False, 123 readonly = False, 124 vocabulary = high_grade, 125 ) 126 hq_school = schema.TextLine( 127 title = _(u'Institution Attended'), 128 required = False, 129 readonly = False, 130 ) 131 hq_session = schema.TextLine( 132 title = _(u'Years Attended'), 133 required = False, 134 readonly = False, 135 ) 136 hq_disc = schema.TextLine( 137 title = _(u'Discipline'), 138 required = False, 139 readonly = False, 140 ) 92 141 jamb_subjects = schema.Text( 93 142 title = _(u'Subjects and Scores'), … … 208 257 vocabulary = exam_types, 209 258 ) 210 #presently = schema.Bool(211 # title = _(u'Attending'),212 # required = False,213 # readonly = False,214 # )215 259 presently_inst = schema.TextLine( 216 260 title = _(u'If yes, name of institution'),
Note: See TracChangeset for help on using the changeset viewer.