Ignore:
Timestamp:
17 Dec 2011, 12:54:39 (13 years ago)
Author:
Henrik Bettermann
Message:

Define two different (convenience?) methods: fullname and display_fullname. The first one is a hyphen-separated string of all name parts and is meant for indexing only. The second one uses the SIRPUtils fullname method and is meant for displaying the fullname in the UI. It can be easily customized according to the requirements of the school.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/student.py

    r7359 r7364  
    6464
    6565    @property
    66     def fullname(self):
     66    def display_fullname(self):
    6767        middlename = getattr(self, 'middlename', None)
    6868        sirp_utils = getUtility(ISIRPUtils)
    6969        return sirp_utils.fullname(self.firstname, self.lastname, middlename)
     70
     71    @property
     72    def fullname(self):
     73        middlename = getattr(self, 'middlename', None)
     74        if middlename:
     75            return '%s-%s-%s' % (self.firstname.lower(),
     76                middlename.lower(), self.lastname.lower())
     77        else:
     78            return '%s-%s' % (self.firstname.lower(), self.lastname.lower())
    7079
    7180    @property
Note: See TracChangeset for help on using the changeset viewer.