- Timestamp:
- 28 Mar 2012, 06:23:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.custom/trunk/src/waeup/custom/students/browser.py
r7890 r7995 24 24 StudentPersonalDisplayFormPage, StudentPersonalManageFormPage, 25 25 StudentClearanceManageFormPage, StudentClearanceEditFormPage, 26 StudentClearanceDisplayFormPage) 26 StudentClearanceDisplayFormPage, 27 ExportPDFClearanceSlipPage) 27 28 from waeup.kofa.students.viewlets import RequestCallbackActionButton 28 29 from waeup.custom.students.interfaces import ( 29 IStudent, IStudentPersonal, IStudentClearance, IStudentClearanceEdit, 30 IStudent, IStudentPersonal, 31 IUGStudentClearance,IPGStudentClearance, 30 32 ) 31 33 from waeup.custom.interfaces import MessageFactory as _ … … 48 50 """ 49 51 grok.context(IStudent) 50 form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked') 51 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 52 53 @property 54 def form_fields(self): 55 cm = getattr(self.context,'current_mode', None) 56 if cm is not None and cm.startswith('pg'): 57 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 58 else: 59 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 60 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 61 return form_fields 62 63 class ExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage): 64 """Deliver a PDF slip of the context. 65 """ 66 grok.context(IStudent) 67 68 @property 69 def form_fields(self): 70 cm = getattr(self.context,'current_mode', None) 71 if cm is not None and cm.startswith('pg'): 72 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 73 else: 74 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 75 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 76 return form_fields 52 77 53 78 class StudentClearanceManageFormPage(StudentClearanceManageFormPage): … … 55 80 """ 56 81 grok.context(IStudent) 57 form_fields = grok.AutoFields(IStudentClearance) 58 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 82 83 @property 84 def form_fields(self): 85 cm = getattr(self.context,'current_mode', None) 86 if cm is not None and cm.startswith('pg'): 87 form_fields = grok.AutoFields(IPGStudentClearance) 88 else: 89 form_fields = grok.AutoFields(IUGStudentClearance) 90 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 91 return form_fields 59 92 60 93 class StudentClearanceEditFormPage(StudentClearanceEditFormPage): … … 62 95 """ 63 96 grok.context(IStudent) 64 form_fields = grok.AutoFields( 65 IStudentClearanceEdit).omit('clearance_locked') 66 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 97 98 @property 99 def form_fields(self): 100 cm = getattr(self.context,'current_mode', None) 101 if cm is not None and cm.startswith('pg'): 102 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 103 else: 104 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 105 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 106 return form_fields 67 107 68 108 class RequestCallbackActionButton(RequestCallbackActionButton):
Note: See TracChangeset for help on using the changeset viewer.