Changeset 12592 for main/waeup.ikoba/trunk/src
- Timestamp:
- 11 Feb 2015, 11:59:34 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py
r12585 r12592 19 19 """ 20 20 import grok 21 from datetime import date22 21 from zope.component import getUtility, queryUtility 23 22 from zope.catalog.interfaces import ICatalog … … 168 167 if not concat: 169 168 return products 170 now = date.today()169 171 170 resultlist = [ 172 171 value for value in products 173 if value.contract_category == concat 174 and (not value.valid_from or value.valid_from <= now) 175 and (not value.valid_to or value.valid_to >= now) 172 if value.contract_category == concat and value.active 176 173 ] 177 174 return resultlist -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser_templates/containerpage.pt
r12334 r12592 12 12 </thead> 13 13 <tbody> 14 <tr tal:repeat="value context/values"> 15 <td> <a tal:attributes="href python: view.url(value)"> 16 <span tal:content="value/product_id">ID</span></a></td> 17 <td tal:content="value/title">TITLE</td> 18 <td tal:content="value/contract_category_title">CATEGORY</td> 19 </tr> 14 <tal:repeat repeat="value context/values"> 15 <tr tal:condition="python:layout.isAuthenticated() or value.active"> 16 <td> <a tal:attributes="href python: view.url(value)"> 17 <span tal:content="value/product_id">ID</span></a></td> 18 <td tal:content="value/title">TITLE</td> 19 <td tal:content="value/contract_category_title">CATEGORY</td> 20 </tr> 21 </tal:repeat> 20 22 </tbody> 21 23 </table> -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py
r12397 r12592 22 22 from time import time 23 23 from grok import index 24 from datetime import date 24 25 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 25 26 from zope.event import notify … … 62 63 return self.contract_title 63 64 return self.title 65 66 @property 67 def active(self): 68 now = date.today() 69 return (not self.valid_from or self.valid_from <= now) and \ 70 (not self.valid_to or self.valid_to >= now) 64 71 65 72 Product = attrs_to_fields(Product)
Note: See TracChangeset for help on using the changeset viewer.