Commit ce31d1e4 authored by Sebastien Robin's avatar Sebastien Robin

allow to use categories as parameter


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3398 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 01314cda
...@@ -513,14 +513,17 @@ class Resource(XMLMatrix, CoreResource, Variated): ...@@ -513,14 +513,17 @@ class Resource(XMLMatrix, CoreResource, Variated):
def getPrice(self, context=None, REQUEST=None, **kw): def getPrice(self, context=None, REQUEST=None, **kw):
""" """
""" """
category_list = self.getCategoryList() new_category_list = self.getCategoryList()
if context is not None: if context is not None:
category_list += context.getCategoryList() new_category_list += context.getCategoryList()
if not 'resource' in [x.split('/')[0] for x in category_list]: if kw.has_key('categories'):
category_list += ('resource/' + self.getRelativeUrl(),) new_category_list.extend(kw['categories'])
del kw['categories']
if not 'resource' in [x.split('/')[0] for x in new_category_list]:
new_category_list += ('resource/' + self.getRelativeUrl(),)
tmp_context = self.asContext(context=context, tmp_context = self.asContext(context=context,
categories=category_list, categories=new_category_list,
REQUEST=REQUEST, **kw) REQUEST=REQUEST, **kw)
domain_tool = getToolByName(self,'portal_domains') domain_tool = getToolByName(self,'portal_domains')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment