- Timestamp:
- 20 Sep 2012, 08:49:37 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/students/vocabularies.py
r8766 r9209 36 36 nats_vocab = SimpleKofaVocabulary(*COUNTRIES) 37 37 38 def study_levels(studycourse): 39 if studycourse.certificate is not None: 40 start_level = int(studycourse.certificate.start_level) 41 end_level = int(studycourse.certificate.end_level) 38 def study_levels(context): 39 certificate = getattr(context, 'certificate', None) 40 if certificate is not None: 41 start_level = int(certificate.start_level) 42 end_level = int(certificate.end_level) 42 43 if start_level == 999 or end_level == 999: 43 44 levels = [999] … … 50 51 else: 51 52 # default level range 52 levels = [level for level in range(100,1000,10) if level % 100 < 30] 53 levels = [10, ] 54 levels += [level for level in range(100,1000,10) if level % 100 < 30] 55 levels.append(999) 53 56 return levels 54 57 … … 68 71 69 72 def getTitle(self, context, value): 70 if context.certificate is not None: 71 start_level = int(context.certificate.start_level) 72 end_level = int(context.certificate.end_level) 73 certificate = getattr(context, 'certificate', None) 74 if certificate is not None: 75 start_level = int(certificate.start_level) 76 end_level = int(certificate.end_level) 73 77 else: 74 78 # default level range 75 start_level = 10 079 start_level = 10 76 80 end_level = 1000 77 81 if start_level == 999 or end_level == 999: … … 79 83 return _('Error: wrong level id ${value}', 80 84 mapping={'value': value}) 85 if value == 999: 81 86 return course_levels.by_value[999].title 82 87 if value < start_level or value > end_level + 120:
Note: See TracChangeset for help on using the changeset viewer.