Ignore:
Timestamp:
19 Mar 2012, 04:21:47 (13 years ago)
Author:
uli
Message:

Move CertificateSource? to university package. I think this is the right place.

File:
1 edited

Legend:

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

    r7841 r7915  
    121121    def getTitle(self, value):
    122122        return "%s - %s" % (value.code, value.title[:64])
     123
     124class CertificateSource(BasicContextualSourceFactory):
     125    """A certificate source delivers all certificates provided
     126    in the portal.
     127    """
     128    def getValues(self, context):
     129        catalog = getUtility(ICatalog, name='certificates_catalog')
     130        return sorted(list(
     131                catalog.searchResults(
     132                    code=('', 'z*'))),
     133                    key=lambda value: value.code)
     134
     135    def getToken(self, context, value):
     136        return value.code
     137
     138    def getTitle(self, context, value):
     139        return "%s - %s" % (value.code, value.title[:64])
Note: See TracChangeset for help on using the changeset viewer.