Changeset 7357 for main/waeup.sirp/trunk/src/waeup/sirp/students
- Timestamp:
- 16 Dec 2011, 06:40:31 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7351 r7357 319 319 grok.require('waeup.manageStudent') 320 320 grok.name('addstudent') 321 grok.template('studentaddpage')322 form_fields = grok.AutoFields(IStudent)321 form_fields = grok.AutoFields(IStudent).select( 322 'firstname', 'middlename', 'lastname') 323 323 title = 'Students' 324 324 label = 'Add student' -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r7331 r7357 115 115 faccode = Attribute('The faculty code of any chosen study course') 116 116 current_session = Attribute('The current session of the student') 117 fullname = Attribute('The fullname of an applicant') 117 118 118 119 def loggerInfo(ob_class, comment): … … 126 127 ) 127 128 128 fullname = schema.TextLine( 129 title = u'Full Name', 130 default = None, 129 firstname = schema.TextLine( 130 title = u'First Name', 131 required = True, 132 ) 133 134 middlename = schema.TextLine( 135 title = u'Middle Name', 136 required = False, 137 ) 138 139 lastname = schema.TextLine( 140 title = u'Last Name (Surname)', 131 141 required = True, 132 142 ) -
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r7321 r7357 62 62 63 63 @property 64 def fullname(self): 65 # We do not necessarily have the middlename attribute 66 middlename = getattr(self, 'middlename', None) 67 if middlename: 68 return '%s %s %s' % (self.firstname, 69 middlename, self.lastname) 70 else: 71 return '%s %s' % (self.firstname, self.lastname) 72 73 @property 64 74 def state(self): 65 75 state = IWorkflowState(self).getState() -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data.csv
r7133 r7357 1 firstname,lastname, fullname,reg_number,date_of_birth,matric_number,email,phone2 Aaren,Pieri, Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,12343 Aaren,Finau, Aaren Finau,2,1990-01-03,100001,aa@aa.ng,12344 Aaren,Berson, Aaren Berson,3,1990-01-04,100002,aa@aa.ng,12341 firstname,lastname,reg_number,date_of_birth,matric_number,email,phone 2 Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234 3 Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234 4 Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234 -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data_migration.csv
r7273 r7357 1 student_id,firstname,lastname, fullname,reg_number,date_of_birth,matric_number,email,phone2 A123456,Aaren,Pieri, Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,12343 B123456,Aaren,Finau, Aaren Finau,2,1990-01-03,100001,aa@aa.ng,12344 C123456,Aaren,Berson, Aaren Berson,3,1990-01-04,100002,aa@aa.ng,12341 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone 2 A123456,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234 3 B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234 4 C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234 -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py
r7273 r7357 93 93 # Add student with subobjects 94 94 student = Student() 95 student.fullname = u'Anna Tester' 95 student.firstname = u'Anna' 96 student.lastname = u'Tester' 96 97 student.reg_number = u'123' 97 98 student.matric_number = u'234' -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7351 r7357 87 87 # Add student with subobjects 88 88 student = Student() 89 student.fullname = u'Anna Tester' 89 student.firstname = u'Anna' 90 student.lastname = u'Tester' 90 91 student.reg_number = u'123' 91 92 student.matric_number = u'234' … … 245 246 self.assertEqual(self.browser.headers['Status'], '200 Ok') 246 247 self.assertEqual(self.browser.url, self.add_student_path) 247 self.browser.getControl(name="form.fullname").value = 'Bob Tester' 248 self.browser.getControl(name="form.firstname").value = 'Bob' 249 self.browser.getControl(name="form.lastname").value = 'Tester' 248 250 self.browser.getControl("Create student record").click() 249 251 self.assertTrue('Student record created' in self.browser.contents) … … 323 325 # Managers can edit base data and fire transitions 324 326 self.browser.getControl(name="transition").value = ['admit'] 325 self.browser.getControl(name="form.fullname").value = 'John Tester' 327 self.browser.getControl(name="form.firstname").value = 'John' 328 self.browser.getControl(name="form.lastname").value = 'Tester' 326 329 self.browser.getControl(name="form.reg_number").value = '345' 327 330 self.browser.getControl(name="password").value = 'secret' … … 375 378 # Lazy student is studying CERT1 376 379 lazystudent = Student() 377 lazystudent.fullname = u'Lazy Student' 380 lazystudent.firstname = u'Lazy' 381 lazystudent.lastname = u'Student' 378 382 self.app['students'].addStudent(lazystudent) 379 383 student_id = lazystudent.student_id … … 633 637 # Prepare a csv file for students 634 638 open('students.csv', 'wb').write( 635 """firstname,lastname, fullname,reg_number,date_of_birth,matric_number,email,phone636 Aaren,Pieri, Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,1234637 Claus,Finau, Claus Finau,2,1990-01-03,100001,aa@aa.ng,1234638 Brit,Berson, Brit Berson,3,1990-01-04,100001,aa@aa.ng,1234639 """firstname,lastname,reg_number,date_of_birth,matric_number,email,phone 640 Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234 641 Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234 642 Brit,Berson,3,1990-01-04,100001,aa@aa.ng,1234 639 643 """) 640 644 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 734 738 # ... but not other students 735 739 other_student = Student() 736 other_student.fullname = u'Dep2 Student' 740 other_student.firstname = u'Dep2' 741 other_student.lastname = u'Student' 737 742 self.app['students'].addStudent(other_student) 738 743 other_student_path = ( … … 815 820 # ... but not other students 816 821 other_student = Student() 817 other_student.fullname = u'Dep2 Student' 822 other_student.firstname = u'Dep2' 823 other_student.lastname = u'Student' 818 824 self.app['students'].addStudent(other_student) 819 825 other_student_path = ( … … 924 930 student = Student() 925 931 student.reg_number = u'123456' 926 student.fullname = u'Klaus Tester' 932 student.firstname = u'Klaus' 933 student.lastname = u'Tester' 927 934 self.app['students'].addStudent(student) 928 935 setpassword_path = 'http://localhost/app/setpassword' -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py
r7203 r7357 56 56 # Create student with studycourse subobject 57 57 student = Student() 58 student.fullname = u'Bob Tester' 58 student.firstname = u'Bob' 59 student.lastname = u'Tester' 59 60 self.app['students'].addStudent(student) 60 61 self.student_id = student.student_id
Note: See TracChangeset for help on using the changeset viewer.