Commit 4a466c0f authored by Romain Courteaud's avatar Romain Courteaud

Write method getVariationBaseCategoryList with the parameter

omit_option_base_category.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3487 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e3423c1
...@@ -55,6 +55,23 @@ class Variated(Base): ...@@ -55,6 +55,23 @@ class Variated(Base):
# Declarative interfaces # Declarative interfaces
__implements__ = (Interface.Variated, ) __implements__ = (Interface.Variated, )
security.declareProtected(Permissions.AccessContentsInformation,
'getVariationBaseCategoryList')
def getVariationBaseCategoryList(self, omit_option_base_category=0):
"""
Return the list of variation base category.
If omit_option_base_category==1, do not include base category
considered as option (ex: industrial_phase).
"""
vbcl = self._baseGetVariationBaseCategoryList()
if omit_option_base_category == 1:
# XXX First implementation
# option base category list is a portal method, until the creation
# of a good API.
option_base_category_list = self.getPortalOptionBaseCategoryList()
vbcl = [x for x in vbcl if x not in option_base_category_list]
return vbcl
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'_getVariationCategoryList') '_getVariationCategoryList')
def _getVariationCategoryList(self, base_category_list = ()): def _getVariationCategoryList(self, base_category_list = ()):
...@@ -64,7 +81,8 @@ class Variated(Base): ...@@ -64,7 +81,8 @@ class Variated(Base):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getVariationCategoryList') 'getVariationCategoryList')
def getVariationCategoryList(self, base_category_list=()): def getVariationCategoryList(self, base_category_list=(),
omit_option_base_category=0):
""" """
Returns the list of possible variations Returns the list of possible variations
""" """
......
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