Changeset 7838 for main/waeup.kofa/trunk
- Timestamp:
- 11 Mar 2012, 16:03:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py
r7819 r7838 37 37 ) 38 38 39 class SemesterSource(Basic ContextualSourceFactory):39 class SemesterSource(BasicSourceFactory): 40 40 """An institution type source delivers semester or term descriptors. 41 41 """ 42 def getValues(self, context): 43 semesters_dict = getUtility(IKofaUtils).getSemesterDict() 44 return semesters_dict.keys() 45 46 def getToken(self, context, value): 42 def getValues(self): 43 try: 44 # We have to 'try', don't know why (henrik) 45 # Alternatively, we can use BasicContextualSourceFactory, 46 # see sources below 47 from waeup.kofa.interfaces import IKofaUtils 48 return getUtility(IKofaUtils).getSemesterDict().keys() 49 except: 50 return [9] 51 52 def getToken(self, value): 47 53 return str(value) 48 54 49 def getTitle(self, context, value): 50 semesters_dict = getUtility(IKofaUtils).getSemesterDict() 51 return semesters_dict[value] 55 def getTitle(self, value): 56 try: 57 from waeup.kofa.interfaces import IKofaUtils 58 semesters_dict = getUtility(IKofaUtils).getSemesterDict() 59 return semesters_dict[value] 60 except: 61 value 52 62 53 63 class InstTypeSource(BasicContextualSourceFactory):
Note: See TracChangeset for help on using the changeset viewer.