- Timestamp:
- 3 Jul 2020, 07:11:31 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/browser.py
r16077 r16142 54 54 ICustomPGApplicant, ICustomUGApplicant, ICustomApplicant, 55 55 ICustomPGApplicantEdit, ICustomUGApplicantEdit, 56 ICustomApplicantOnlinePayment, ICustomApplicantRefereeReport 56 ICustomApplicantOnlinePayment, ICustomApplicantRefereeReport, 57 ITranscriptApplicant 57 58 ) 58 59 from kofacustom.iuokada.interfaces import MessageFactory as _ … … 120 121 'screening_date',) 121 122 123 TRANS_OMIT_FIELDS = ('locked', 'suspended', 'applicant_id',) 124 125 TRANS_SHORT_OMIT_FIELDS = TRANS_OMIT_FIELDS + ( 126 'date_of_birth', 127 'sex', 128 'nationality', 129 'entry_mode', 130 'entry_session', 131 'end_session', 132 'course_studied', 133 'course_changed', 134 'change_level', 135 ) 136 122 137 class CustomApplicantsContainerPage(ApplicantsContainerPage): 123 138 """The standard view for regular applicant containers. … … 143 158 @property 144 159 def form_fields(self): 160 if self.target is not None and self.target == 'transfull': 161 form_fields = grok.AutoFields(ITranscriptApplicant) 162 for field in TRANS_OMIT_FIELDS: 163 form_fields = form_fields.omit(field) 164 form_fields['dispatch_address'].custom_widget = BytesDisplayWidget 165 form_fields['perm_address'].custom_widget = BytesDisplayWidget 166 return form_fields 167 if self.target is not None and self.target == 'transshort': 168 form_fields = grok.AutoFields(ITranscriptApplicant) 169 for field in TRANS_SHORT_OMIT_FIELDS: 170 form_fields = form_fields.omit(field) 171 form_fields['dispatch_address'].custom_widget = BytesDisplayWidget 172 form_fields['perm_address'].custom_widget = BytesDisplayWidget 173 return form_fields 145 174 if self.target is not None and self.target.startswith('pg'): 146 175 form_fields = grok.AutoFields(ICustomPGApplicant) … … 207 236 @property 208 237 def form_fields(self): 238 if self.target is not None and self.target == 'transfull': 239 form_fields = grok.AutoFields(ITranscriptApplicant) 240 for field in TRANS_OMIT_FIELDS: 241 form_fields = form_fields.omit(field) 242 return form_fields 243 if self.target is not None and self.target == 'transshort': 244 form_fields = grok.AutoFields(ITranscriptApplicant) 245 for field in TRANS_SHORT_OMIT_FIELDS: 246 form_fields = form_fields.omit(field) 247 return form_fields 209 248 if self.target is not None and self.target.startswith('pg'): 210 249 form_fields = grok.AutoFields(ICustomPGApplicant) … … 281 320 @property 282 321 def form_fields(self): 322 if self.target is not None and self.target == 'transfull': 323 form_fields = grok.AutoFields(ITranscriptApplicant) 324 for field in TRANS_OMIT_FIELDS: 325 form_fields = form_fields.omit(field) 326 return form_fields 327 if self.target is not None and self.target == 'transshort': 328 form_fields = grok.AutoFields(ITranscriptApplicant) 329 for field in TRANS_SHORT_OMIT_FIELDS: 330 form_fields = form_fields.omit(field) 331 return form_fields 283 332 if self.target is not None and self.target.startswith('pg'): 284 333 form_fields = grok.AutoFields(ICustomPGApplicantEdit)
Note: See TracChangeset for help on using the changeset viewer.