Changeset 16152 for main/waeup.uniben/trunk/src/waeup/uniben
- Timestamp:
- 8 Jul 2020, 20:32:51 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r16151 r16152 23 23 from zope import schema 24 24 #from zope.interface import invariant, Invalid 25 #from zope.component import getUtility26 #from zope.catalog.interfaces import ICatalog25 from zope.component import getUtility 26 from zope.catalog.interfaces import ICatalog 27 27 from zc.sourcefactory.basic import BasicSourceFactory 28 28 from waeup.kofa.applicants.interfaces import ( … … 55 55 from waeup.uniben.payments.interfaces import ICustomOnlinePayment 56 56 57 class TranscriptCertificateSource(CertificateSource): 58 """Include Department and Faculty in Title. 59 """ 60 def getValues(self, context): 61 catalog = getUtility(ICatalog, name='certificates_catalog') 62 resultset = catalog.searchResults(code=(None, None)) 63 resultlist = sorted(resultset, key=lambda 64 value: value.__parent__.__parent__.__parent__.code + 65 value.__parent__.__parent__.code + 66 value.code) 67 return resultlist 68 69 def getTitle(self, context, value): 70 """ 71 """ 72 try: title = "%s / %s / %s (%s)" % ( 73 value.__parent__.__parent__.__parent__.title, 74 value.__parent__.__parent__.title, 75 value.title, value.code) 76 except AttributeError: 77 title = "NA / %s (%s)" % (value.title, value.code) 78 return title 57 79 58 80 REGISTRATION_CATS = { … … 340 362 course_studied = schema.Choice( 341 363 title = _(u'Course of Study'), 342 source = CertificateSource(), 364 source = TranscriptCertificateSource(), 365 description = u'Faculty / Department / Study Course', 343 366 required = False, 344 367 readonly = False, … … 348 371 title = _(u'Change of Study Course / Transfer'), 349 372 description = u'If yes, select previous course of study.', 350 source = CertificateSource(),373 source = TranscriptCertificateSource(), 351 374 readonly = False, 352 375 required = False,
Note: See TracChangeset for help on using the changeset viewer.