- Timestamp:
- 31 Jan 2022, 09:14:15 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py
r16548 r16763 51 51 from waeup.aaue.applicants.interfaces import ( 52 52 ICustomUGApplicant, 53 ICustomPGApplicant, 53 54 ICustomUGApplicantEdit, 55 ICustomPGApplicantEdit, 54 56 ITranscriptApplicant, 55 57 ICertificateRequest, … … 155 157 156 158 PG_OMIT_FIELDS = ( 157 'fst_sit_fname', 158 'fst_sit_no', 159 'fst_sit_date', 160 'fst_sit_type', 161 'fst_sit_results', 162 'scd_sit_fname', 163 'scd_sit_no', 164 'scd_sit_date', 165 'scd_sit_type', 166 'scd_sit_results', 167 #'programme_type', 168 'jamb_age', 169 'jamb_subjects', 170 'jamb_score', 171 'jamb_reg_number', 172 'aggregate' 159 173 160 ) 174 161 PG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + ( 175 'jamb_subjects_list',) + PG_OMIT_FIELDS162 ) + PG_OMIT_FIELDS 176 163 PG_OMIT_PDF_FIELDS = PG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS + ( 177 'reg_number','alr_fname', 'alr_no', 'alr_date',178 'alr_results', 'notice',179 'nysc_year',180 'nysc_location',181 'nysc_lga',182 'former_matric',183 164 ) 184 165 PG_OMIT_MANAGE_FIELDS = ( 185 'special_application','jamb_subjects_list',) + PG_OMIT_FIELDS166 ) + PG_OMIT_FIELDS 186 167 PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + ( 187 'student_id',188 'notice',189 168 ) 190 169 … … 269 248 form_fields = grok.AutoFields(ICertificateRequest).omit( 270 249 'locked', 'suspended') 271 #form_fields['dispatch_address'].custom_widget = BytesDisplayWidget 272 #form_fields['perm_address'].custom_widget = BytesDisplayWidget 273 return form_fields 274 # AAUE is using the same interface for all regular applications. 275 form_fields = grok.AutoFields(ICustomUGApplicant) 276 if self.target is not None and self.target.startswith('pg'): 250 return form_fields 251 if self.target is not None and self.target in ('ptee','dsh',): 252 form_fields = grok.AutoFields(ICustomUGApplicant) 253 for field in PTEE_OMIT_DISPLAY_FIELDS: 254 form_fields = form_fields.omit(field) 255 elif self.target is not None and self.target in ('bridge', 'ude',): 256 form_fields = grok.AutoFields(ICustomUGApplicant) 257 for field in UDE_OMIT_DISPLAY_FIELDS: 258 form_fields = form_fields.omit(field) 259 elif self.target is not None and self.target.startswith('pg'): 260 form_fields = grok.AutoFields(ICustomPGApplicant) 277 261 for field in PG_OMIT_DISPLAY_FIELDS: 278 262 form_fields = form_fields.omit(field) 279 elif self.target is not None and self.target in ('ptee','dsh',):280 for field in PTEE_OMIT_DISPLAY_FIELDS:281 form_fields = form_fields.omit(field)282 elif self.target is not None and self.target in ('bridge', 'ude',):283 for field in UDE_OMIT_DISPLAY_FIELDS:284 form_fields = form_fields.omit(field)285 263 else: 264 form_fields = grok.AutoFields(ICustomUGApplicant) 286 265 for field in UG_OMIT_DISPLAY_FIELDS: 287 266 form_fields = form_fields.omit(field) 288 form_fields['perm_address'].custom_widget = BytesDisplayWidget289 form_fields['notice'].custom_widget = BytesDisplayWidget290 267 if not getattr(self.context, 'student_id'): 291 268 form_fields = form_fields.omit('student_id') … … 367 344 if self.target is not None and self.target.startswith('pg'): 368 345 for field in PG_OMIT_PDF_FIELDS: 346 form_fields = grok.AutoFields(ICustomPGApplicant) 369 347 form_fields = form_fields.omit(field) 370 348 elif self.target is not None and self.target in ('ptee', 'dsh',): … … 400 378 if not getattr(self.context, 'screening_date'): 401 379 form_fields = form_fields.omit('screening_date') 380 hqfields = ('hq_type', 'hq_fname', 'hq_matric_no', 381 'hq_degree', 'hq_school', 'hq_session', 'hq_disc') 382 if not getattr(self.context, 'hq_type'): 383 for hq in hqfields: 384 form_fields = form_fields.omit(hq) 385 if not getattr(self.context, 'hq_type2'): 386 for hq in hqfields: 387 form_fields = form_fields.omit(hq + '2') 388 if not getattr(self.context, 'hq_type3'): 389 for hq in hqfields: 390 form_fields = form_fields.omit(hq + '3') 391 if not getattr(self.context, 'hq_type4'): 392 for hq in hqfields: 393 form_fields = form_fields.omit(hq + '4') 402 394 return form_fields 403 395 … … 444 436 form_fields = grok.AutoFields(ICustomUGApplicant) 445 437 if self.target is not None and self.target.startswith('pg'): 438 form_fields = grok.AutoFields(ICustomPGApplicant) 446 439 for field in PG_OMIT_MANAGE_FIELDS: 447 440 form_fields = form_fields.omit(field) … … 579 572 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 580 573 if self.target is not None and self.target.startswith('pg'): 574 form_fields = grok.AutoFields(ICustomPGApplicantEdit) 581 575 for field in PG_OMIT_EDIT_FIELDS: 582 576 form_fields = form_fields.omit(field)
Note: See TracChangeset for help on using the changeset viewer.