- Timestamp:
- 30 Nov 2014, 20:49:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py
r12093 r12097 121 121 122 122 class AppCatProductSource(SmartBasicContextualSourceFactory): 123 """An applicationcategory product delivers all products124 which belong to a certain application_category.123 """An contract category product delivers all products 124 which belong to a certain contract_category. 125 125 """ 126 126 def contains(self, context, value): 127 appcat = getattr(context, ' application_category', None)128 if value. application_category == appcat:127 appcat = getattr(context, 'contract_category', None) 128 if value.contract_category == appcat: 129 129 return True 130 130 return False 131 131 132 132 def getValues(self, context): 133 appcat = getattr(context, ' application_category', None)133 appcat = getattr(context, 'contract_category', None) 134 134 products = grok.getSite()['products'].values() 135 135 if not appcat: 136 136 return products 137 137 resultlist = [ 138 value for value in products if value. application_category == appcat]138 value for value in products if value.contract_category == appcat] 139 139 return resultlist 140 140
Note: See TracChangeset for help on using the changeset viewer.