Changeset 8607 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 2 Jun 2012, 17:55:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r8589 r8607 79 79 80 80 class AppCatCertificateSource(CertificateSource): 81 """An application certificate source delivers all courses which belong to 82 a certain application_category. 83 """ 81 """An application certificate source delivers all certificates 82 which belong to a certain application_category. 83 84 This source is meant to be used with Applicants. 85 86 The application category must match the application category of 87 the context parent, normally an applicants container. 88 """ 89 def contains(self, context, value): 90 context_appcat = getattr(getattr( 91 context, '__parent__', None), 'application_category', None) 92 if context_appcat is None: 93 # If the context (applicant) has no application category, 94 # then it might be not part of a container (yet), for 95 # instance during imports. We consider this correct. 96 return True 97 if value.application_category == context_appcat: 98 return True 99 return False 100 84 101 def getValues(self, context): 85 102 # appliction category not available when certificate was deleted. … … 92 109 application_category=(appcat,appcat)) 93 110 result = sorted(result, key=lambda value: value.code) 111 # XXX: What does the following mean here? 94 112 curr_course = context.course1 95 113 if curr_course is not None and curr_course not in result:
Note: See TracChangeset for help on using the changeset viewer.