Ignore:
Timestamp:
22 Feb 2012, 21:14:09 (13 years ago)
Author:
Henrik Bettermann
Message:

Uses sources instead of vocabularies and feed sources with dictionaries defined in SIRPUtils. This way we can easily customize the sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.py

    r7334 r7681  
    2222from zope.component.interfaces import IFactory
    2323from zope.interface import implementedBy
     24from zope.component import getUtility
     25from waeup.sirp.interfaces import ISIRPUtils
    2426from waeup.sirp.university.interfaces import (
    2527    IFaculty, IFacultyAdd, IDepartment)
    26 from waeup.sirp.university.vocabularies import inst_types
    2728
    2829class Faculty(grok.Container):
     
    6061
    6162    def longtitle(self):
    62         try:
    63             result = "%s %s (%s)" % (
    64                 inst_types.getTerm(
    65                     self.title_prefix).title,
    66                 self.title, self.code)
    67         except:
    68             result = "%s (%s)" % (self.title, self.code)
     63        insttypes_dict = getUtility(ISIRPUtils).getInstTypeDict()
     64        result = "%s %s (%s)" % (
     65            insttypes_dict[self.title_prefix],
     66            self.title, self.code)
    6967        return result
    7068
Note: See TracChangeset for help on using the changeset viewer.