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/department.py

    r7334 r7681  
    1919"""
    2020import grok
    21 from zope.component import createObject
    2221from zope.component.interfaces import IFactory
    2322from zope.interface import implementedBy
     23from zope.component import getUtility
     24from waeup.sirp.university.coursescontainer import CoursesContainer
     25from waeup.sirp.university.certificatescontainer import CertificatesContainer
     26from waeup.sirp.interfaces import ISIRPUtils
    2427from waeup.sirp.university.interfaces import IDepartment, IDepartmentAdd
    25 from waeup.sirp.university.vocabularies import inst_types
    2628
    2729class Department(grok.Container):
     
    5355        self.title_prefix = title_prefix
    5456        self.code = code
    55         self.courses = createObject(u'waeup.CoursesContainer')
     57        self.courses = CoursesContainer()
    5658        self.courses.__parent__ = self
    5759        self.courses.__name__ = 'courses'
    58         self.certificates = createObject(u'waeup.CertificatesContainer')
     60        self.certificates = CertificatesContainer()
    5961        self.certificates.__parent__ = self
    6062        self.certificates.__name__ = 'certificates'
     
    7173
    7274    def longtitle(self):
     75        insttypes_dict = getUtility(ISIRPUtils).getInstTypeDict()
    7376        return "%s %s (%s)" % (
    74             inst_types.getTerm(self.title_prefix).title,
     77            insttypes_dict[self.title_prefix],
    7578            self.title, self.code)
    7679
Note: See TracChangeset for help on using the changeset viewer.