- Timestamp:
- 6 Jul 2022, 11:38:52 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py
r16983 r16997 19 19 """ 20 20 import grok 21 from zope.formlib.textwidgets import BytesDisplayWidget 22 from waeup.kofa.applicants.pdf import PDFApplicationSlip 21 23 from waeup.kofa.applicants.browser import ( 22 ApplicantRegistrationPage, ApplicantsContainerPage) 23 from kofacustom.nigeria.applicants.browser import ( 24 NigeriaApplicantDisplayFormPage, 25 NigeriaApplicantManageFormPage, 26 NigeriaApplicantEditFormPage, 27 NigeriaPDFApplicationSlip) 24 ApplicantRegistrationPage, ApplicantsContainerPage, 25 ApplicantDisplayFormPage, 26 ApplicantManageFormPage, 27 ApplicantEditFormPage) 28 28 29 from kofacustom.nigeria.applicants.interfaces import (30 INigeriaPGApplicant, INigeriaUGApplicant,31 INigeriaPGApplicantEdit, INigeriaUGApplicantEdit,32 INigeriaApplicantOnlinePayment,33 UG_OMIT_DISPLAY_FIELDS,34 UG_OMIT_PDF_FIELDS,35 UG_OMIT_MANAGE_FIELDS,36 UG_OMIT_EDIT_FIELDS,37 PG_OMIT_DISPLAY_FIELDS,38 PG_OMIT_PDF_FIELDS,39 PG_OMIT_MANAGE_FIELDS,40 PG_OMIT_EDIT_FIELDS,41 )42 29 from kofacustom.lpng.applicants.interfaces import ( 43 ICustomPGApplicant, ICustomUGApplicant, ICustomApplicant, 44 ICustomPGApplicantEdit, ICustomUGApplicantEdit, 30 ICustomApplicant, 45 31 ICustomApplicantOnlinePayment, 46 32 ) … … 48 34 from kofacustom.lpng.interfaces import MessageFactory as _ 49 35 50 class CustomApplicantEditFormPage(NigeriaApplicantEditFormPage): 36 37 class CustomApplicantDisplayFormPage(ApplicantDisplayFormPage): 38 """A display view for applicant data. 39 """ 40 41 @property 42 def form_fields(self): 43 form_fields = grok.AutoFields(ICustomApplicant) 44 form_fields['perm_address'].custom_widget = BytesDisplayWidget 45 form_fields['notice'].custom_widget = BytesDisplayWidget 46 if not getattr(self.context, 'student_id'): 47 form_fields = form_fields.omit('student_id') 48 return form_fields 49 50 class CustomPDFApplicationSlip(PDFApplicationSlip): 51 52 @property 53 def form_fields(self): 54 form_fields = grok.AutoFields(ICustomApplicant) 55 if not getattr(self.context, 'student_id'): 56 form_fields = form_fields.omit('student_id') 57 return form_fields 58 59 class CustomApplicantManageFormPage(ApplicantManageFormPage): 60 """A full edit view for applicant data. 61 """ 62 63 @property 64 def form_fields(self): 65 form_fields = grok.AutoFields(ICustomApplicant) 66 if not getattr(self.context, 'student_id'): 67 form_fields = form_fields.omit('student_id') 68 form_fields['applicant_id'].for_display = True 69 return form_fields 70 71 class CustomApplicantEditFormPage(ApplicantEditFormPage): 51 72 """An applicant-centered edit view for applicant data. 52 73 """ … … 55 76 return True 56 77 78 @property 79 def form_fields(self): 80 form_fields = grok.AutoFields(ICustomApplicant) 81 form_fields = form_fields.omit('notice') 82 if not getattr(self.context, 'student_id'): 83 form_fields = form_fields.omit('student_id') 84 form_fields['applicant_id'].for_display = True 85 form_fields['reg_number'].for_display = True 86 return form_fields 87
Note: See TracChangeset for help on using the changeset viewer.