Changeset 7993 for main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
- Timestamp:
- 27 Mar 2012, 20:59:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r7878 r7993 49 49 from waeup.kofa.widgets.phonewidget import PhoneWidget 50 50 from waeup.kofa.students.interfaces import ( 51 IStudentsContainer, IStudent, IStudentClearance, 51 IStudentsContainer, IStudent, 52 IUGStudentClearance,IPGStudentClearance, 52 53 IStudentPersonal, IStudentBase, IStudentStudyCourse, 53 54 IStudentAccommodation, IStudentStudyLevel, … … 393 394 grok.name('view_clearance') 394 395 grok.require('waeup.viewStudent') 395 form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked') 396 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 397 pnav = 4 396 pnav = 4 397 398 @property 399 def form_fields(self): 400 cm = getattr(self.context,'current_mode', None) 401 if cm is not None and cm.startswith('pg'): 402 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 403 else: 404 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 405 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 406 return form_fields 398 407 399 408 @property … … 408 417 grok.name('clearance.pdf') 409 418 grok.require('waeup.viewStudent') 410 form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked')411 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')412 419 prefix = 'form' 420 421 @property 422 def form_fields(self): 423 cm = getattr(self.context,'current_mode', None) 424 if cm is not None and cm.startswith('pg'): 425 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 426 else: 427 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 428 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 429 return form_fields 413 430 414 431 @property … … 440 457 grok.require('waeup.manageStudent') 441 458 grok.template('clearanceeditpage') 442 form_fields = grok.AutoFields(IStudentClearance)443 459 label = _('Manage clearance data') 444 460 pnav = 4 445 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 461 462 @property 463 def form_fields(self): 464 cm = getattr(self.context,'current_mode', None) 465 if cm is not None and cm.startswith('pg'): 466 form_fields = grok.AutoFields(IPGStudentClearance) 467 else: 468 form_fields = grok.AutoFields(IUGStudentClearance) 469 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 470 return form_fields 446 471 447 472 def update(self): … … 1561 1586 grok.name('cedit') 1562 1587 grok.require('waeup.handleStudent') 1563 form_fields = grok.AutoFields(1564 IStudentClearance).omit('clearance_locked')1565 1588 label = _('Edit clearance data') 1566 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 1589 1590 @property 1591 def form_fields(self): 1592 cm = getattr(self.context,'current_mode', None) 1593 if cm is not None and cm.startswith('pg'): 1594 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 1595 else: 1596 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 1597 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 1598 return form_fields 1567 1599 1568 1600 def update(self):
Note: See TracChangeset for help on using the changeset viewer.