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