Changeset 6774 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 14 Sep 2011, 21:14:05 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6773 r6774 34 34 IStudentsContainer, IStudent, IStudentClearance, IStudentPasswordSetting, 35 35 IStudentPersonal, IStudentBase, IStudentStudyCourse, IStudentPayments, 36 IStudentAccommodation, IStudentClearanceEdit, 36 IStudentAccommodation, IStudentClearanceEdit, IStudentStudyLevel, 37 37 ) 38 38 from waeup.sirp.students.catalog import search 39 39 from waeup.sirp.students.workflow import CLEARANCE 40 from waeup.sirp.students.studylevel import StudentStudyLevel 40 41 41 42 # Save function used for save methods in manager pages … … 132 133 grok.name('setpassword') 133 134 grok.require('waeup.Public') 135 grok.template('setpassword') 134 136 title = '' 135 137 label = 'Set password for first-time login' … … 475 477 return 476 478 479 @grok.action('Add level') 480 def addStudyLevel(self, **data): 481 studylevel = StudentStudyLevel() 482 studylevel.level = str(self.context.current_level) 483 self.context.addStudentStudyLevel(studylevel) 484 return 485 486 class StudyCourseAddActionButton(AddActionButton): 487 grok.order(1) 488 grok.context(IStudentStudyCourse) 489 grok.view(StudyCourseManageFormPage) 490 grok.require('waeup.manageStudents') 491 text = 'Add study level' 492 target = '' 493 494 class StudyLevelDisplayFormPage(WAeUPDisplayFormPage): 495 """ Page to display student study levels 496 """ 497 grok.context(IStudentStudyLevel) 498 grok.name('index') 499 grok.require('waeup.viewStudent') 500 form_fields = grok.AutoFields(IStudentStudyCourse) 501 #grok.template('studylevelpage') 502 title = 'Study Level' 503 pnav = 4 504 505 @property 506 def label(self): 507 return '%s: Study Level' % self.context.__parent__.name 508 477 509 class PaymentsDisplayFormPage(WAeUPDisplayFormPage): 478 510 """ Page to display the student payments -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6771 r6774 202 202 ) 203 203 204 class IStudentStudyLevel(IWAeUPObject): 205 """A container for course tickets. 206 207 """ 208 level = Attribute('The level code') 209 204 210 class IStudentAccommodation(IWAeUPObject): 205 211 """A container for student accommodation objects. -
main/waeup.sirp/trunk/src/waeup/sirp/students/studycourse.py
r6642 r6774 22 22 from zope.component.interfaces import IFactory 23 23 from waeup.sirp.students.interfaces import ( 24 IStudentStudyCourse, IStudentNavigation )24 IStudentStudyCourse, IStudentNavigation, IStudentStudyLevel) 25 25 from waeup.sirp.utils.helpers import attrs_to_fields 26 26 … … 38 38 return self.__parent__ 39 39 40 def addStudentStudyLevel(self, studylevel): 41 """Add a study level object. 42 """ 43 if not IStudentStudyLevel.providedBy(studylevel): 44 raise TypeError( 45 'StudentStudyCourses contain only IStudentStudyLevel instances') 46 self[studylevel.level] = studylevel 47 return 48 40 49 StudentStudyCourse = attrs_to_fields(StudentStudyCourse)
Note: See TracChangeset for help on using the changeset viewer.