Changeset 6750 for main/waeup.sirp
- Timestamp:
- 13 Sep 2011, 16:21:44 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6722 r6750 548 548 grok.require('waeup.handleStudent') 549 549 form_fields = grok.AutoFields(IStudentBaseEdit).omit( 550 'student_id', 'reg_number' )550 'student_id', 'reg_number', 'matric_number') 551 551 grok.template('baseeditpage') 552 552 label = 'Change password' -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt
r6695 r6750 23 23 <table class="display dataTableManage"> 24 24 <thead> 25 <tr> 26 <th>Student Id</th><th>Name</th> 27 </tr> 25 <tr> 26 <th>Student Id</th> 27 <th>Registration Number</th> 28 <th>Matriculation Number</th> 29 <th>Name</th> 30 </tr> 28 31 </thead> 29 32 <tbody> 30 31 33 <tr tal:repeat="item view/hitlist"> 34 <td> <a tal:attributes="href item/url"> 32 35 <span tal:content="item/student_id">A123456</span></a> 33 36 </td> 34 <td tal:content="item/name">Bob</td> 35 </tr> 37 <td> <a tal:attributes="href item/url"> 38 <span tal:content="item/reg_number">9999999</span></a> 39 </td> 40 <td> <a tal:attributes="href item/url"> 41 <span tal:content="item/matric_number">9999999</span></a> 42 </td> 43 <td tal:content="item/name">Bob</td> 44 </tr> 36 45 </tbody> 37 46 </table> -
main/waeup.sirp/trunk/src/waeup/sirp/students/catalog.py
r6696 r6750 6 6 from hurry.query.query import Query 7 7 from zope.index.text.parsetree import ParseError 8 from waeup.sirp.index import UniqueField 8 9 from waeup.sirp.interfaces import IUniversity, IQueryResultItem 9 10 from waeup.sirp.students.interfaces import IStudent … … 18 19 student_id = index.Field(attribute='student_id') 19 20 name = index.Text(attribute='name') 20 reg_number = index.Field(attribute='reg_number') 21 reg_number = UniqueField(attribute='reg_number') 22 matric_number = UniqueField(attribute='matric_number') 21 23 state = index.Field(attribute='state') 22 24 … … 33 35 self.name = context.name 34 36 self.reg_number = context.reg_number 37 self.matric_number = context.matric_number 35 38 self.state = context.state 36 39 -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6744 r6750 86 86 default = u'', 87 87 required = True, 88 readonly = False, 89 ) 90 91 matric_number = schema.TextLine( 92 title = u'Matriculation Number', 93 default = u'', 94 required = False, 88 95 readonly = False, 89 96 ) -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6714 r6750 34 34 from hurry.workflow.interfaces import IWorkflowInfo 35 35 from waeup.sirp.testing import ( 36 FunctionalLayer, FunctionalTestCase, remove_logger, 37 remove_new_loggers, 38 ) 36 FunctionalLayer, FunctionalTestCase, remove_new_loggers, 37 ) 39 38 from waeup.sirp.app import University 40 39 from waeup.sirp.students.container import StudentsContainer … … 78 77 student = Student() 79 78 student.name = u'Anna Tester' 79 student.reg_number = u'123' 80 student.matric_number = u'234' 80 81 self.test_student_id = self.app['students'].addStudent(student) 81 82 # Set password … … 164 165 self.browser.getControl("Create student record").click() 165 166 self.assertTrue('Student record created' in self.browser.contents) 167 168 # Registration numbers must be unique 169 self.browser.getLink("Manage").click() 170 self.browser.getControl(name="form.reg_number").value = '123' 171 self.browser.getControl("Save").click() 172 self.assertMatches('...value already exists in catalog...', 173 self.browser.contents) 166 174 167 175 self.browser.open(self.container_path)
Note: See TracChangeset for help on using the changeset viewer.