Changeset 7525 for main/waeup.custom/trunk
- Timestamp:
- 27 Jan 2012, 18:24:31 (13 years ago)
- Location:
- main/waeup.custom/trunk/src/waeup/custom/students
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.custom/trunk/src/waeup/custom/students/browser.py
r7505 r7525 18 18 import grok 19 19 from zope.formlib.textwidgets import BytesDisplayWidget 20 from waeup.custom.students.interfaces import IStudent, IStudentPersonal 21 from waeup.sirp.students.browser import StudentPersonalDisplayFormPage 20 from waeup.sirp.widgets.datewidget import ( 21 FriendlyDateWidget, FriendlyDateDisplayWidget 22 ) 23 from waeup.custom.students.interfaces import ( 24 IStudent, IStudentPersonal, IStudentClearance, IStudentClearanceEdit 25 ) 26 from waeup.sirp.students.browser import ( 27 StudentPersonalDisplayFormPage, StudentPersonalManageFormPage, 28 StudentClearanceManageFormPage, StudentClearanceEditFormPage, 29 StudentClearanceDisplayFormPage 30 ) 22 31 23 32 class StudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage): … … 28 37 form_fields['perm_address'].custom_widget = BytesDisplayWidget 29 38 39 class StudentPersonalManageFormPage(StudentPersonalManageFormPage): 40 """ Page to edit student clearance data 41 """ 42 grok.context(IStudent) 43 form_fields = grok.AutoFields(IStudentPersonal) 30 44 45 class StudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage): 46 """ Page to display student clearance data 47 """ 48 grok.context(IStudent) 49 form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked') 50 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 51 52 class StudentClearanceManageFormPage(StudentClearanceManageFormPage): 53 """ Page to edit student clearance data 54 """ 55 grok.context(IStudent) 56 form_fields = grok.AutoFields(IStudentClearance) 57 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 58 59 class StudentClearanceEditFormPage(StudentClearanceEditFormPage): 60 """ View to edit student clearance data by student 61 """ 62 grok.context(IStudent) 63 form_fields = grok.AutoFields( 64 IStudentClearanceEdit).omit('clearance_locked') 65 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 66 67 -
main/waeup.custom/trunk/src/waeup/custom/students/interfaces.py
r7505 r7525 21 21 IStudentBase,IStudentClearance,IStudentPersonal,IStudentNavigation, 22 22 ) 23 from waeup.sirp.students.vocabularies import lgas_vocab, nats_vocab 23 24 24 25 class IStudentPersonal(IStudentPersonal): … … 46 47 date_of_birth = schema.Date( 47 48 title = u'Date of Birth', 48 required = True,49 required = False, 49 50 ) 50 51 … … 59 60 required = False, 60 61 readonly = True, 62 ) 63 64 nationality = schema.Choice( 65 source = nats_vocab, 66 title = u'Nationality', 67 default = 'nigeria', 68 required = False, 69 ) 70 71 lga = schema.Choice( 72 source = lgas_vocab, 73 title = u'State/LGA', 74 required = False, 61 75 ) 62 76 -
main/waeup.custom/trunk/src/waeup/custom/students/student.py
r7505 r7525 42 42 # set. 43 43 Student = attrs_to_fields(Student) 44 45 class StudentFactory(StudentFactory):46 """A factory for students.47 """48 49 def __call__(self, *args, **kw):50 return Student()51 52 def getInterfaces(self):53 return implementedBy(Student)
Note: See TracChangeset for help on using the changeset viewer.