Changeset 10710 for main/waeup.kwarapoly
- Timestamp:
- 6 Nov 2013, 17:15:39 (11 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/browser.py
r10705 r10710 18 18 import grok 19 19 from zope.i18n import translate 20 from zope.formlib.textwidgets import BytesDisplayWidget 20 21 from zope.component import getUtility 21 22 from hurry.workflow.interfaces import IWorkflowInfo … … 39 40 NigeriaStudentClearanceEditFormPage, 40 41 NigeriaExportPDFCourseRegistrationSlipPage, 42 NigeriaStudentPersonalDisplayFormPage, 43 NigeriaStudentPersonalEditFormPage, 44 NigeriaStudentPersonalManageFormPage 41 45 ) 42 46 43 from waeup.kwarapoly.students.interfaces import ICustomStudentOnlinePayment 47 from waeup.kwarapoly.students.interfaces import ( 48 ICustomStudentOnlinePayment, 49 ICustomStudentPersonal, 50 ICustomStudentPersonalEdit 51 ) 52 53 class CustomStudentPersonalDisplayFormPage(NigeriaStudentPersonalDisplayFormPage): 54 """ Page to display student personal data 55 """ 56 form_fields = grok.AutoFields(ICustomStudentPersonal) 57 form_fields['perm_address'].custom_widget = BytesDisplayWidget 58 form_fields['next_kin_address'].custom_widget = BytesDisplayWidget 59 form_fields['corr_address'].custom_widget = BytesDisplayWidget 60 form_fields['sponsor_address'].custom_widget = BytesDisplayWidget 61 form_fields[ 62 'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le') 63 64 class CustomStudentPersonalEditFormPage(NigeriaStudentPersonalEditFormPage): 65 """ Page to edit personal data 66 """ 67 form_fields = grok.AutoFields(ICustomStudentPersonalEdit).omit( 68 'personal_updated') 69 70 class CustomStudentPersonalManageFormPage(NigeriaStudentPersonalManageFormPage): 71 """ Page to edit personal data 72 """ 73 form_fields = grok.AutoFields(ICustomStudentPersonal) 74 form_fields['personal_updated'].for_display = True 75 form_fields[ 76 'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le') 44 77 45 78 class CustomOnlinePaymentDisplayFormPage(NigeriaOnlinePaymentDisplayFormPage): -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/interfaces.py
r10705 r10710 45 45 title = _(u'Correspondence Address'), 46 46 required = False, 47 ) 48 49 sponsor_name = schema.TextLine( 50 title = _(u'Sponsor\'s Name'), 51 required = False, 52 readonly = False, 53 ) 54 55 sponsor_address = schema.Text( 56 title = _(u'Sponsor\'s Address'), 57 required = False, 58 readonly = False, 59 ) 60 61 class ICustomStudentPersonalEdit(ICustomStudentPersonal): 62 """Interface for editing personal data by students. 63 64 Here we can repeat the fields from IStudentPersonal and set the 65 `required` if necessary. 66 """ 67 68 perm_address = schema.Text( 69 title = _(u'Home Address'), 70 required = True, 71 ) 72 73 corr_address = schema.Text( 74 title = _(u'Correspondence Address'), 75 required = True, 47 76 ) 48 77 -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/student.py
r9347 r10710 25 25 from waeup.kofa.students.interfaces import IStudentNavigation 26 26 from kofacustom.nigeria.students.student import NigeriaStudent 27 from waeup.kwarapoly.students.interfaces import ICustomStudent 27 from waeup.kwarapoly.students.interfaces import ( 28 ICustomStudent, ICustomStudentPersonalEdit) 28 29 29 30 class CustomStudent(NigeriaStudent): … … 31 32 owned by students. 32 33 """ 33 grok.implements(ICustomStudent, IStudentNavigation) 34 grok.implements(ICustomStudent, 35 ICustomStudentPersonalEdit, IStudentNavigation) 34 36 grok.provides(ICustomStudent) 35 37
Note: See TracChangeset for help on using the changeset viewer.