Changeset 7356 for main/waeup.sirp


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

Replace middlenames by middlename.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py

    r7355 r7356  
    7171    @property
    7272    def fullname(self):
    73         # We do not necessarily have the middlenames attribute
    74         middlenames = getattr(self, 'middlenames', None)
    75         if middlenames:
     73        # We do not necessarily have the middlename attribute
     74        middlename = getattr(self, 'middlename', None)
     75        if middlename:
    7676            return '%s %s %s' % (self.firstname,
    77                 middlenames, self.lastname)
     77                middlename, self.lastname)
    7878        else:
    7979            return '%s %s' % (self.firstname, self.lastname)
     
    102102        # Fire transition 'create'
    103103        IWorkflowInfo(self).fireTransition('create')
    104 
    105         # TODO: Split fullname in students package and copy first,
    106         # middle and lastname
    107 
    108104        # Copy some base data
    109         student.fullname = self.fullname
     105        student.firstname = self.firstname
     106        student.lastname = self.lastname
    110107        student.sex = self.sex
    111108        student.date_of_birth = self.date_of_birth
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r7351 r7356  
    413413    #grok.template('applicantaddpage')
    414414    form_fields = grok.AutoFields(IApplicant).select(
    415         'firstname', 'middlenames', 'lastname',
     415        'firstname', 'middlename', 'lastname',
    416416        'email', 'phone')
    417417    title = 'Applicants'
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r7351 r7356  
    309309        required = True,
    310310        )
    311     middlenames = schema.TextLine(
    312         title = u'Middle Names',
     311    middlename = schema.TextLine(
     312        title = u'Middle Name',
    313313        required = False,
    314314        )
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7348 r7356  
    289289        self.assertEqual(self.browser.url, self.add_applicant_path)
    290290        self.browser.getControl(name="form.firstname").value = 'Alois'
    291         self.browser.getControl(name="form.middlenames").value = 'Kofi'
     291        self.browser.getControl(name="form.middlename").value = 'Kofi'
    292292        self.browser.getControl(name="form.lastname").value = 'Bettermann'
    293293        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
Note: See TracChangeset for help on using the changeset viewer.