- Timestamp:
- 26 Jul 2012, 06:23:18 (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
r9050 r9054 22 22 from zope.i18n import translate 23 23 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 24 from zope.formlib.textwidgets import BytesDisplayWidget 24 25 from waeup.kofa.students.interfaces import IStudentsUtils 25 26 from waeup.kofa.applicants.interfaces import ( … … 39 40 INigeriaPGApplicantEdit, INigeriaUGApplicantEdit, 40 41 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 UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS, PUTME_OMIT_EDIT_FIELDS, 45 PUTME_OMIT_RESULT_SLIP_FIELDS) 42 UG_OMIT_DISPLAY_FIELDS, 43 UG_OMIT_PDF_FIELDS, 44 UG_OMIT_MANAGE_FIELDS, 45 UG_OMIT_EDIT_FIELDS, 46 PG_OMIT_DISPLAY_FIELDS, 47 PG_OMIT_PDF_FIELDS, 48 PG_OMIT_MANAGE_FIELDS, 49 PG_OMIT_EDIT_FIELDS, 50 PUTME_OMIT_DISPLAY_FIELDS, 51 PUTME_OMIT_PDF_FIELDS, 52 PUTME_OMIT_MANAGE_FIELDS, 53 PUTME_OMIT_EDIT_FIELDS, 54 PUTME_OMIT_RESULT_SLIP_FIELDS, 55 PUDE_OMIT_DISPLAY_FIELDS, 56 PUDE_OMIT_PDF_FIELDS, 57 PUDE_OMIT_MANAGE_FIELDS, 58 PUDE_OMIT_EDIT_FIELDS, 59 PUDE_OMIT_RESULT_SLIP_FIELDS, 60 ) 46 61 from kofacustom.nigeria.interfaces import MessageFactory as _ 47 62 … … 78 93 for field in PUTME_OMIT_DISPLAY_FIELDS: 79 94 form_fields = form_fields.omit(field) 95 elif target is not None and target.startswith('pude'): 96 form_fields = grok.AutoFields(INigeriaUGApplicant) 97 for field in PUDE_OMIT_DISPLAY_FIELDS: 98 form_fields = form_fields.omit(field) 80 99 else: 81 100 form_fields = grok.AutoFields(INigeriaUGApplicant) 82 101 for field in UG_OMIT_DISPLAY_FIELDS: 83 102 form_fields = form_fields.omit(field) 103 form_fields['perm_address'].custom_widget = BytesDisplayWidget 104 form_fields['notice'].custom_widget = BytesDisplayWidget 84 105 return form_fields 85 106 … … 113 134 for field in PUTME_OMIT_PDF_FIELDS: 114 135 form_fields = form_fields.omit(field) 136 elif target is not None and target.startswith('pude'): 137 form_fields = grok.AutoFields(INigeriaUGApplicant) 138 if self._reduced_slip(): 139 for field in PUDE_OMIT_RESULT_SLIP_FIELDS: 140 form_fields = form_fields.omit(field) 141 else: 142 for field in PUDE_OMIT_PDF_FIELDS: 143 form_fields = form_fields.omit(field) 115 144 else: 116 145 form_fields = grok.AutoFields(INigeriaUGApplicant) … … 136 165 for field in PUTME_OMIT_MANAGE_FIELDS: 137 166 form_fields = form_fields.omit(field) 167 elif target is not None and target.startswith('pude'): 168 form_fields = grok.AutoFields(INigeriaUGApplicant) 169 for field in PUDE_OMIT_MANAGE_FIELDS: 170 form_fields = form_fields.omit(field) 138 171 else: 139 172 form_fields = grok.AutoFields(INigeriaUGApplicant) … … 158 191 form_fields = grok.AutoFields(IPUTMEApplicantEdit) 159 192 for field in PUTME_OMIT_EDIT_FIELDS: 193 form_fields = form_fields.omit(field) 194 elif target is not None and target.startswith('pude'): 195 form_fields = grok.AutoFields(INigeriaUGApplicant) 196 for field in PUDE_OMIT_EDIT_FIELDS: 160 197 form_fields = form_fields.omit(field) 161 198 else: -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/interfaces.py
r9049 r9054 68 68 'screening_date') 69 69 70 # PUDE is a subgroup of UG with the same interface. 71 PUDE_OMIT_FIELDS = ( 72 'jamb_subjects','jamb_score', 'aggregate') 73 PUDE_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUDE_OMIT_FIELDS 74 PUDE_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUDE_OMIT_FIELDS 75 PUDE_OMIT_EDIT_FIELDS = set(UG_OMIT_EDIT_FIELDS + PUDE_OMIT_FIELDS + ( 76 'firstname', 'middlename', 'lastname', 'sex', 77 'course1', 'lga')) 78 PUDE_OMIT_PDF_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + ('email', 'phone') 79 PUDE_OMIT_RESULT_SLIP_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + ( 80 'email', 'phone', 81 'date_of_birth', 'sex', 82 'nationality', 'lga', 'perm_address', 83 'course2', 'screening_venue', 84 'screening_date') 85 70 86 # PG has its own interface 71 87 PG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS
Note: See TracChangeset for help on using the changeset viewer.