Changeset 11250 for main/waeup.aaue
- Timestamp:
- 22 Feb 2014, 14:35:57 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/branches/henrik-diazo-themed/src/waeup/aaue/applicants/browser.py
r10929 r11250 35 35 UG_OMIT_PDF_FIELDS, 36 36 UG_OMIT_MANAGE_FIELDS, 37 UG_OMIT_EDIT_FIELDS, 38 PG_OMIT_DISPLAY_FIELDS, 39 PG_OMIT_PDF_FIELDS, 40 PG_OMIT_MANAGE_FIELDS, 41 PG_OMIT_EDIT_FIELDS) 37 UG_OMIT_EDIT_FIELDS) 42 38 from waeup.aaue.applicants.interfaces import ( 43 39 ICustomApplicant, 44 40 ICustomUGApplicant, 45 ICustomPGApplicant, 46 ICustomPGApplicantEdit, 47 ICustomUGApplicantEdit) 41 ICustomUGApplicantEdit 42 ) 48 43 49 UG_OMIT_PDF_FIELDS = [50 element for element in UG_OMIT_PDF_FIELDS if not element == 'phone'] 44 UG_OMIT_PDF_FIELDS = tuple([ 45 element for element in UG_OMIT_PDF_FIELDS if not element == 'phone']) 51 46 UG_OMIT_PDF_FIELDS += ('reg_number','alr_fname', 'alr_no', 'alr_date', 52 47 'alr_results', 'notice') 48 49 FP_OMIT_FIELDS = ('hq_type', 'hq_fname', 'hq_matric_no', 50 'hq_degree', 'hq_school', 'hq_session', 'hq_disc') 51 FP_OMIT_DISPLAY_FIELDS = UG_OMIT_DISPLAY_FIELDS + FP_OMIT_FIELDS 52 FP_OMIT_PDF_FIELDS = UG_OMIT_PDF_FIELDS + FP_OMIT_FIELDS 53 FP_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + FP_OMIT_FIELDS 54 FP_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + FP_OMIT_FIELDS 53 55 54 56 class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage): … … 58 60 @property 59 61 def form_fields(self): 60 if self.target is not None and self.target.startswith('pg'):61 form_fields = grok.AutoFields(ICustomPGApplicant)62 for field in PG_OMIT_DISPLAY_FIELDS:62 form_fields = grok.AutoFields(ICustomUGApplicant) 63 if self.target is not None and self.target.startswith('fp'): 64 for field in FP_OMIT_DISPLAY_FIELDS: 63 65 form_fields = form_fields.omit(field) 64 66 else: 65 form_fields = grok.AutoFields(ICustomUGApplicant)66 67 for field in UG_OMIT_DISPLAY_FIELDS: 67 68 form_fields = form_fields.omit(field) … … 104 105 @property 105 106 def form_fields(self): 106 if self.target is not None and self.target.startswith('pg'):107 form_fields = grok.AutoFields(ICustomPGApplicant)108 for field in PG_OMIT_PDF_FIELDS:107 form_fields = grok.AutoFields(ICustomUGApplicant) 108 if self.target is not None and self.target.startswith('fp'): 109 for field in FP_OMIT_PDF_FIELDS: 109 110 form_fields = form_fields.omit(field) 110 111 else: 111 form_fields = grok.AutoFields(ICustomUGApplicant)112 112 for field in UG_OMIT_PDF_FIELDS: 113 113 form_fields = form_fields.omit(field) … … 128 128 @property 129 129 def form_fields(self): 130 if self.target is not None and self.target.startswith('pg'):131 form_fields = grok.AutoFields(ICustomPGApplicant)132 for field in PG_OMIT_MANAGE_FIELDS:130 form_fields = grok.AutoFields(ICustomUGApplicant) 131 if self.target is not None and self.target.startswith('fp'): 132 for field in FP_OMIT_MANAGE_FIELDS: 133 133 form_fields = form_fields.omit(field) 134 134 else: 135 form_fields = grok.AutoFields(ICustomUGApplicant)136 135 for field in UG_OMIT_MANAGE_FIELDS: 137 136 form_fields = form_fields.omit(field) … … 146 145 @property 147 146 def form_fields(self): 148 if self.target is not None and self.target.startswith('pg'):149 form_fields = grok.AutoFields(ICustomPGApplicantEdit)150 for field in PG_OMIT_EDIT_FIELDS:147 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 148 if self.target is not None and self.target.startswith('fp'): 149 for field in FP_OMIT_EDIT_FIELDS: 151 150 form_fields = form_fields.omit(field) 152 151 else: 153 form_fields = grok.AutoFields(ICustomUGApplicantEdit)154 152 for field in UG_OMIT_EDIT_FIELDS: 155 153 form_fields = form_fields.omit(field)
Note: See TracChangeset for help on using the changeset viewer.