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.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r7903 r7915  
    3434from waeup.kofa.schoolgrades import ResultEntryField
    3535from waeup.kofa.students.vocabularies import (
    36     lgas_vocab, CertificateSource, GenderSource)
     36    lgas_vocab, GenderSource)
    3737from waeup.kofa.university.vocabularies import (
    38     course_levels, AppCatSource)
     38    course_levels, AppCatSource, CertificateSource)
    3939
    4040#: Maximum upload size for applicant passport photographs (in bytes)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r7841 r7915  
    2525from waeup.kofa.interfaces import MessageFactory as _
    2626from waeup.kofa.schema import TextLineChoice
    27 from waeup.kofa.university.vocabularies import CourseSource, StudyModeSource
    2827from waeup.kofa.students.vocabularies import (
    29   CertificateSource, StudyLevelSource,
    30   contextual_reg_num_source, contextual_mat_num_source,
    31   GenderSource, nats_vocab,
    32   )
     28    StudyLevelSource, contextual_reg_num_source, contextual_mat_num_source,
     29    GenderSource, nats_vocab,
     30    )
    3331from waeup.kofa.payments.interfaces import IPaymentsContainer, IOnlinePayment
     32from waeup.kofa.university.vocabularies import (
     33    CourseSource, StudyModeSource, CertificateSource)
    3434
    3535# VerdictSource can't be placed into the vocabularies module because it
  • main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py

    r7872 r7915  
    9999        return title
    100100
    101 class CertificateSource(BasicContextualSourceFactory):
    102     """A certificate source delivers all certificates provided
    103     in the portal.
    104     """
    105     def getValues(self, context):
    106         catalog = getUtility(ICatalog, name='certificates_catalog')
    107         return sorted(list(
    108                 catalog.searchResults(
    109                     code=('', 'z*'))),
    110                     key=lambda value: value.code)
    111 
    112     def getToken(self, context, value):
    113         return value.code
    114 
    115     def getTitle(self, context, value):
    116         return "%s - %s" % (value.code, value.title[:64])
    117 
    118 
    119101class GenderSource(BasicSourceFactory):
    120102    """A gender source delivers basically a mapping
  • 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.