Ignore:
Timestamp:
22 May 2013, 19:04:48 (11 years ago)
Author:
Henrik Bettermann
Message:

Customize getCertTitle.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/applicants/utils.py

    r10088 r10203  
    3333      'form.student_id': _(u'Process Data'),
    3434      }
     35
     36    def filterCertificates(self, context, resultset):
     37        """Filter and sort certificates in AppCatCertificateSource.
     38        """
     39        return sorted(resultset, key=lambda value: value.code)
     40
     41    def getCertTitle(self, context, value):
     42        """Compose the titles in AppCatCertificateSource.
     43        """
     44        if None not in (getattr(value, 'custom_textline_1'),
     45            getattr(value, 'custom_float_1')):
     46            return "%s - %s [%s, %d]" % (
     47                value.code, value.title,
     48                value.custom_textline_1, value.custom_float_1)
     49        return "%s - %s" % (value.code, value.title)
Note: See TracChangeset for help on using the changeset viewer.