Changeset 6818 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 27 Sep 2011, 08:00:33 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r6690 r6818 161 161 """ 162 162 if IStudentNavigation.providedBy(self.context): 163 return self.context.getStudent(). name163 return self.context.getStudent().fullname 164 164 return 165 165 -
main/waeup.sirp/trunk/src/waeup/sirp/students/authentication.py
r6768 r6818 52 52 @property 53 53 def title(self): 54 return self.context. name54 return self.context.fullname 55 55 56 56 @property -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6810 r6818 79 79 title = u'Students' 80 80 81 class StudentBreadcrumb(Breadcrumb): 82 """A breadcrumb for the student container. 83 """ 84 grok.context(IStudent) 85 86 def title(self): 87 return self.context.fullname 88 81 89 class SudyCourseBreadcrumb(Breadcrumb): 82 90 """A breadcrumb for the student study course. … … 292 300 @property 293 301 def label(self): 294 return '%s: Base Data' % self.context. name302 return '%s: Base Data' % self.context.fullname 295 303 296 304 @property … … 393 401 @property 394 402 def label(self): 395 return '%s: Clearance Data' % self.context. name403 return '%s: Clearance Data' % self.context.fullname 396 404 397 405 class StudentClearanceManageActionButton(ManageActionButton): … … 437 445 @property 438 446 def label(self): 439 return '%s: Personal Data' % self.context. name447 return '%s: Personal Data' % self.context.fullname 440 448 441 449 class StudentPersonalManageActionButton(ManageActionButton): … … 476 484 @property 477 485 def label(self): 478 return '%s: Study Course' % self.context.__parent__. name486 return '%s: Study Course' % self.context.__parent__.fullname 479 487 480 488 class StudyCourseManageActionButton(ManageActionButton): … … 573 581 def label(self): 574 582 return '%s: Study Level %s' % ( 575 self.context.getStudent(). name,self.context.level_title)583 self.context.getStudent().fullname,self.context.level_title) 576 584 577 585 @property … … 707 715 def label(self): 708 716 return '%s: Course Ticket %s' % ( 709 self.context.getStudent(). name,self.context.code)717 self.context.getStudent().fullname,self.context.code) 710 718 711 719 class CourseTicketManageActionButton(ManageActionButton): … … 753 761 @property 754 762 def label(self): 755 return '%s: Payments' % self.context.__parent__. name763 return '%s: Payments' % self.context.__parent__.fullname 756 764 757 765 class AccommodationDisplayFormPage(WAeUPDisplayFormPage): … … 768 776 @property 769 777 def label(self): 770 return '%s: Accommodation Data' % self.context.__parent__. name778 return '%s: Accommodation Data' % self.context.__parent__.fullname 771 779 772 780 class StudentHistoryPage(WAeUPPage): … … 782 790 @property 783 791 def label(self): 784 return '%s: History' % self.context. name792 return '%s: History' % self.context.fullname 785 793 786 794 # Pages for students only … … 805 813 806 814 def __init__(self, context): 807 self.name = context. name815 self.name = context.fullname 808 816 self.password_repeat = context.password 809 817 self.context = context -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt
r6765 r6818 9 9 <select name="searchtype"> 10 10 <option value="student_id">with id</option> 11 <option value=" name">with name</option>11 <option value="fullname">with name</option> 12 12 <option value="reg_number">with registration number</option> 13 13 <option value="matric_number">with matriculation number</option> … … 23 23 <input type="hidden" name="old_searchtype" 24 24 tal:attributes="value view/searchtype" /> 25 <table class="display dataTable Manage">25 <table class="display dataTable"> 26 26 <thead> 27 27 <tr> … … 29 29 <th>Registration Number</th> 30 30 <th>Matriculation Number</th> 31 <th> Name</th>31 <th>Fullname</th> 32 32 </tr> 33 33 </thead> … … 43 43 <span tal:content="item/matric_number">9999999</span></a> 44 44 </td> 45 <td tal:content="item/ name">Bob</td>45 <td tal:content="item/fullname">Bob</td> 46 46 </tr> 47 47 </tbody> -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentaddpage.pt
r6651 r6818 7 7 <tbody> 8 8 <tr> 9 <td><label for="form. name">Full Name:</label></td>9 <td><label for="form.fullname">Full Name:</label></td> 10 10 <td> 11 <input name="form. name" type="text" size="30" maxlength="30"11 <input name="form.fullname" type="text" size="30" maxlength="30" 12 12 value="" /> 13 13 </td> -
main/waeup.sirp/trunk/src/waeup/sirp/students/catalog.py
r6814 r6818 18 18 19 19 student_id = index.Field(attribute='student_id') 20 name = index.Text(attribute='name')20 fullname = index.Text(attribute='fullname') 21 21 reg_number = index.Field(attribute='reg_number') 22 22 matric_number = index.Field(attribute='matric_number') … … 34 34 self.url = view.url(context) 35 35 self.student_id = context.student_id 36 self. name = context.name36 self.fullname = context.fullname 37 37 self.reg_number = context.reg_number 38 38 self.matric_number = context.matric_number … … 41 41 def search(query=None, searchtype=None, view=None): 42 42 hitlist = [] 43 if searchtype in (' name',):43 if searchtype in ('fullname',): 44 44 results = Query().searchResults( 45 45 Text(('students_catalog', searchtype), query)) -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6814 r6818 103 103 ) 104 104 105 name = schema.TextLine(105 fullname = schema.TextLine( 106 106 title = u'Full Name', 107 default = u'Nobody',107 default = None, 108 108 required = True, 109 109 ) … … 111 111 reg_number = TextLineChoice( 112 112 title = u'Registration Number', 113 #default = u'',113 default = None, 114 114 required = True, 115 115 readonly = False, -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py
r6756 r6818 65 65 class FakeStudent(object): 66 66 student_id = 'test_stud' 67 name = 'Test User'67 fullname = 'Test User' 68 68 password = None 69 69 -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6810 r6818 69 69 setSite(app) 70 70 71 # Add student with subobjects (done by addStudent)71 # Add student with subobjects 72 72 student = Student() 73 student. name = u'Anna Tester'73 student.fullname = u'Anna Tester' 74 74 student.reg_number = u'123' 75 75 student.matric_number = u'234' … … 186 186 self.assertEqual(self.browser.headers['Status'], '200 Ok') 187 187 self.assertEqual(self.browser.url, self.add_student_path) 188 self.browser.getControl(name="form. name").value = 'Bob Tester'188 self.browser.getControl(name="form.fullname").value = 'Bob Tester' 189 189 self.browser.getControl("Create student record").click() 190 190 self.assertTrue('Student record created' in self.browser.contents) … … 213 213 self.browser.getControl("Search").click() 214 214 self.assertTrue('Empty search string' in self.browser.contents) 215 self.browser.getControl(name="searchtype").value = [' name']215 self.browser.getControl(name="searchtype").value = ['fullname'] 216 216 self.browser.getControl(name="searchterm").value = 'Anna Tester' 217 217 self.browser.getControl("Search").click() … … 255 255 # Managers can edit base data and fire transitions 256 256 self.browser.getControl(name="transition").value = ['admit'] 257 self.browser.getControl(name="form. name").value = 'John Tester'257 self.browser.getControl(name="form.fullname").value = 'John Tester' 258 258 self.browser.getControl(name="form.reg_number").value = '345' 259 259 self.browser.getControl(name="password").value = 'secret' … … 429 429 student = Student() 430 430 student.reg_number = u'123456' 431 student. name = u'Klaus Tester'431 student.fullname = u'Klaus Tester' 432 432 test_student_id = self.app['students'].addStudent(student) 433 433 setpassword_path = 'http://localhost/app/setpassword' -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py
r6733 r6818 44 44 # Create students 45 45 student = Student() 46 student. name = u'Bob Tester'46 student.fullname = u'Bob Tester' 47 47 student.student_id = u'A123456' 48 48 self.app['students'][student.student_id] = student … … 74 74 # We can find a certain name 75 75 cat = queryUtility(ICatalog, name='students_catalog') 76 results = cat.searchResults( name='Bob Tester')76 results = cat.searchResults(fullname='Bob Tester') 77 77 results = [x for x in results] # Turn results generator into list 78 78 assert len(results) == 1
Note: See TracChangeset for help on using the changeset viewer.