Changeset 8090
- Timestamp:
- 10 Apr 2012, 09:17:02 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r8080 r8090 23 23 FriendlyDatetimeDisplayWidget) 24 24 from waeup.uniben.widgets.phonewidget import PhoneWidget 25 from waeup.kofa.applicants.interfaces import ( 26 IApplicantRegisterUpdate, IApplicant, IApplicantEdit) 25 27 from waeup.kofa.applicants.browser import (ApplicantDisplayFormPage, 26 28 OnlinePaymentCallbackPage, ExportPDFPage, 27 ApplicantManageFormPage, ApplicantEditFormPage) 29 ApplicantManageFormPage, ApplicantEditFormPage, 30 ApplicantRegistrationPage, ApplicantAddFormPage) 28 31 from waeup.kofa.applicants.viewlets import RequestCallbackActionButton 29 32 from waeup.kofa.applicants.pdf import PDFApplicationSlip … … 59 62 'date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 60 63 return form_fields 64 65 class ApplicantAddFormPage(ApplicantAddFormPage): 66 """Add-form to add an applicant. 67 """ 68 form_fields = grok.AutoFields(IApplicant).select( 69 'firstname', 'middlename', 'lastname', 70 'email', 'phone') 71 form_fields['phone'].custom_widget = PhoneWidget 61 72 62 73 class ApplicantDisplayFormPage(ApplicantDisplayFormPage): … … 134 145 form_fields['reg_number'].for_display = True 135 146 return form_fields 147 148 class ApplicantRegistrationPage(ApplicantRegistrationPage): 149 """Captcha'd registration page for applicants. 150 """ 151 152 @property 153 def form_fields(self): 154 form_fields = None 155 if self.context.mode == 'create': 156 form_fields = grok.AutoFields(IApplicantEdit).select( 157 'firstname', 'middlename', 'lastname', 'email', 'phone') 158 form_fields['phone'].custom_widget = PhoneWidget 159 elif self.context.mode == 'update': 160 form_fields = grok.AutoFields(IApplicantRegisterUpdate).select( 161 'firstname','reg_number','email') 162 return form_fields
Note: See TracChangeset for help on using the changeset viewer.