Changeset 7357 for main


Ignore:
Timestamp:
16 Dec 2011, 06:40:31 (13 years ago)
Author:
Henrik Bettermann
Message:

Replace fullname form field by first-, middle- and lastname form fields.

We don't need a studentaddpage.pt.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py

    r7195 r7357  
    109109        # Add student with subobjects
    110110        student = Student()
    111         student.fullname = u'Anna Tester'
     111        student.firstname = u'Anna'
     112        student.lastname = u'Tester'
    112113        student.reg_number = u'123'
    113114        student.matric_number = u'234'
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7351 r7357  
    319319    grok.require('waeup.manageStudent')
    320320    grok.name('addstudent')
    321     grok.template('studentaddpage')
    322     form_fields = grok.AutoFields(IStudent)
     321    form_fields = grok.AutoFields(IStudent).select(
     322        'firstname', 'middlename', 'lastname')
    323323    title = 'Students'
    324324    label = 'Add student'
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r7331 r7357  
    115115    faccode = Attribute('The faculty code of any chosen study course')
    116116    current_session = Attribute('The current session of the student')
     117    fullname = Attribute('The fullname of an applicant')
    117118
    118119    def loggerInfo(ob_class, comment):
     
    126127        )
    127128
    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)',
    131141        required = True,
    132142        )
  • main/waeup.sirp/trunk/src/waeup/sirp/students/student.py

    r7321 r7357  
    6262
    6363    @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
    6474    def state(self):
    6575        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,phone
    2 Aaren,Pieri,Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,1234
    3 Aaren,Finau,Aaren Finau,2,1990-01-03,100001,aa@aa.ng,1234
    4 Aaren,Berson,Aaren Berson,3,1990-01-04,100002,aa@aa.ng,1234
     1firstname,lastname,reg_number,date_of_birth,matric_number,email,phone
     2Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234
     3Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234
     4Aaren,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,phone
    2 A123456,Aaren,Pieri,Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,1234
    3 B123456,Aaren,Finau,Aaren Finau,2,1990-01-03,100001,aa@aa.ng,1234
    4 C123456,Aaren,Berson,Aaren Berson,3,1990-01-04,100002,aa@aa.ng,1234
     1student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone
     2A123456,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234
     3B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234
     4C123456,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  
    9393        # Add student with subobjects
    9494        student = Student()
    95         student.fullname = u'Anna Tester'
     95        student.firstname = u'Anna'
     96        student.lastname = u'Tester'
    9697        student.reg_number = u'123'
    9798        student.matric_number = u'234'
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7351 r7357  
    8787        # Add student with subobjects
    8888        student = Student()
    89         student.fullname = u'Anna Tester'
     89        student.firstname = u'Anna'
     90        student.lastname = u'Tester'
    9091        student.reg_number = u'123'
    9192        student.matric_number = u'234'
     
    245246        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    246247        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'
    248250        self.browser.getControl("Create student record").click()
    249251        self.assertTrue('Student record created' in self.browser.contents)
     
    323325        # Managers can edit base data and fire transitions
    324326        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'
    326329        self.browser.getControl(name="form.reg_number").value = '345'
    327330        self.browser.getControl(name="password").value = 'secret'
     
    375378        # Lazy student is studying CERT1
    376379        lazystudent = Student()
    377         lazystudent.fullname = u'Lazy Student'
     380        lazystudent.firstname = u'Lazy'
     381        lazystudent.lastname = u'Student'
    378382        self.app['students'].addStudent(lazystudent)
    379383        student_id = lazystudent.student_id
     
    633637        # Prepare a csv file for students
    634638        open('students.csv', 'wb').write(
    635 """firstname,lastname,fullname,reg_number,date_of_birth,matric_number,email,phone
    636 Aaren,Pieri,Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,1234
    637 Claus,Finau,Claus Finau,2,1990-01-03,100001,aa@aa.ng,1234
    638 Brit,Berson,Brit Berson,3,1990-01-04,100001,aa@aa.ng,1234
     639"""firstname,lastname,reg_number,date_of_birth,matric_number,email,phone
     640Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234
     641Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234
     642Brit,Berson,3,1990-01-04,100001,aa@aa.ng,1234
    639643""")
    640644        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    734738        # ... but not other students
    735739        other_student = Student()
    736         other_student.fullname = u'Dep2 Student'
     740        other_student.firstname = u'Dep2'
     741        other_student.lastname = u'Student'
    737742        self.app['students'].addStudent(other_student)
    738743        other_student_path = (
     
    815820        # ... but not other students
    816821        other_student = Student()
    817         other_student.fullname = u'Dep2 Student'
     822        other_student.firstname = u'Dep2'
     823        other_student.lastname = u'Student'
    818824        self.app['students'].addStudent(other_student)
    819825        other_student_path = (
     
    924930        student = Student()
    925931        student.reg_number = u'123456'
    926         student.fullname = u'Klaus Tester'
     932        student.firstname = u'Klaus'
     933        student.lastname = u'Tester'
    927934        self.app['students'].addStudent(student)
    928935        setpassword_path = 'http://localhost/app/setpassword'
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py

    r7203 r7357  
    5656        # Create student with studycourse subobject
    5757        student = Student()
    58         student.fullname = u'Bob Tester'
     58        student.firstname = u'Bob'
     59        student.lastname = u'Tester'
    5960        self.app['students'].addStudent(student)
    6061        self.student_id = student.student_id
Note: See TracChangeset for help on using the changeset viewer.