Changeset 10561


Ignore:
Timestamp:
29 Aug 2013, 15:11:14 (11 years ago)
Author:
Henrik Bettermann
Message:

If no prefix is selected do not prepend a whitespace.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/university
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/university/department.py

    r10279 r10561  
    2323from zope.interface import implementedBy
    2424from zope.component import getUtility
     25from waeup.kofa.university.faculty import longtitle
    2526from waeup.kofa.university.coursescontainer import CoursesContainer
    2627from waeup.kofa.university.certificatescontainer import CertificatesContainer
     
    8687
    8788    def longtitle(self):
    88         insttypes_dict = getUtility(IKofaUtils).INST_TYPES_DICT
    89         return "%s %s (%s)" % (
    90             insttypes_dict[self.title_prefix],
    91             self.title, self.code)
     89        return longtitle(self)
    9290
    9391class DepartmentFactory(grok.GlobalUtility):
  • main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.py

    r10279 r10561  
    2626from waeup.kofa.university.interfaces import (
    2727    IFaculty, IFacultyAdd, IDepartment)
     28
     29def longtitle(inst):
     30    insttypes_dict = getUtility(IKofaUtils).INST_TYPES_DICT
     31    if inst.title_prefix == 'none':
     32        return "%s (%s)" % (inst.title, inst.code)
     33    return "%s %s (%s)" % (
     34        insttypes_dict[inst.title_prefix],
     35        inst.title, inst.code)
    2836
    2937class Faculty(grok.Container):
     
    6573
    6674    def longtitle(self):
    67         insttypes_dict = getUtility(IKofaUtils).INST_TYPES_DICT
    68         result = "%s %s (%s)" % (
    69             insttypes_dict[self.title_prefix],
    70             self.title, self.code)
    71         return result
     75        return longtitle(self)
    7276
    7377class FacultyFactory(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.