Commit e88b00da authored by Jean-Paul Smets's avatar Jean-Paul Smets

getBaseCategoryList instead of getBaseCategoryIdList


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@451 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c60eb9d8
...@@ -141,8 +141,8 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -141,8 +141,8 @@ class CategoryTool( UniqueObject, Folder, Base ):
return apply( ContentFilter, (), self._buildFilter(spec, filter, kw) ) return apply( ContentFilter, (), self._buildFilter(spec, filter, kw) )
# Category accessors # Category accessors
security.declareProtected(Permissions.AccessContentsInformation, 'getBaseCategoryIdList') security.declareProtected(Permissions.AccessContentsInformation, 'getBaseCategoryList')
def getBaseCategoryIdList(self, context=None): def getBaseCategoryList(self, context=None):
""" """
Returns the ids of base categories of the portal_categories tool Returns the ids of base categories of the portal_categories tool
if no context is provided, otherwise, returns the base categories if no context is provided, otherwise, returns the base categories
...@@ -160,7 +160,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -160,7 +160,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
return context._categories return context._categories
security.declareProtected(Permissions.AccessContentsInformation, 'getBaseCategoryIds') security.declareProtected(Permissions.AccessContentsInformation, 'getBaseCategoryIds')
getBaseCategoryIds = getBaseCategoryIdList getBaseCategoryIds = getBaseCategoryList
security.declareProtected(Permissions.AccessContentsInformation, 'baseCategoryIds') security.declareProtected(Permissions.AccessContentsInformation, 'baseCategoryIds')
baseCategoryIds = getBaseCategoryIds baseCategoryIds = getBaseCategoryIds
...@@ -320,7 +320,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -320,7 +320,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
recursive -- if set to 0 do not apply recursively recursive -- if set to 0 do not apply recursively
""" """
if base_category is None: if base_category is None:
base_category_list = self.getBaseCategoryIdList() base_category_list = self.getBaseCategoryList()
elif type(base_category) == type('a'): elif type(base_category) == type('a'):
base_category_list = [base_category] base_category_list = [base_category]
else: else:
...@@ -386,7 +386,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -386,7 +386,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
if type(base_category) == type('a'): if type(base_category) == type('a'):
base_category_list = [base_category] base_category_list = [base_category]
elif base_category is None: elif base_category is None:
base_category_list = self.getBaseCategoryIdList() base_category_list = self.getBaseCategoryList()
else: else:
base_category_list = base_category base_category_list = base_category
if display_none_category: if display_none_category:
...@@ -925,7 +925,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -925,7 +925,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
security.declareProtected( Permissions.AccessContentsInformation, '_getAcquiredCategoryList' ) security.declareProtected( Permissions.AccessContentsInformation, '_getAcquiredCategoryList' )
def _getAcquiredCategoryList(self, context): def _getAcquiredCategoryList(self, context):
result = self.getAcquiredCategoryMembershipList(context, result = self.getAcquiredCategoryMembershipList(context,
base_category = self.getBaseCategoryIdList(context=context)) base_category = self.getBaseCategoryList(context=context))
if getattr(context, 'isCategory', 0): if getattr(context, 'isCategory', 0):
result = tuple(list(result) + [context.getRelativeUrl()]) # Pure category is member of itself result = tuple(list(result) + [context.getRelativeUrl()]) # Pure category is member of itself
return result return result
...@@ -988,7 +988,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -988,7 +988,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
if type(base_category_list) is type('a'): if type(base_category_list) is type('a'):
base_category_list = [base_category_list] base_category_list = [base_category_list]
elif base_category_list is () or base_category_list is None: elif base_category_list is () or base_category_list is None:
base_category_list = self.getBaseCategoryIdList() base_category_list = self.getBaseCategoryList()
category_list = [] category_list = []
#LOG('getRelatedValueList',0,'base_category_list: %s' % str(base_category_list)) #LOG('getRelatedValueList',0,'base_category_list: %s' % str(base_category_list))
for base_category in base_category_list: for base_category in base_category_list:
......
...@@ -894,15 +894,15 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana ...@@ -894,15 +894,15 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
def _setCategoryList(self, path_list): def _setCategoryList(self, path_list):
self.categories = tuple(path_list) self.categories = tuple(path_list)
security.declareProtected( Permissions.View, 'getBaseCategoryIdList' ) security.declareProtected( Permissions.View, 'getBaseCategoryList' )
def getBaseCategoryIdList(self): def getBaseCategoryList(self):
""" """
Lists the base_category ids which apply to this instance Lists the base_category ids which apply to this instance
""" """
return self._getCategoryTool().getBaseCategoryIdList(context=self) return self._getCategoryTool().getBaseCategoryList(context=self)
security.declareProtected( Permissions.View, 'getBaseCategoryIds' ) security.declareProtected( Permissions.View, 'getBaseCategoryIds' )
getBaseCategoryIds = getBaseCategoryIdList getBaseCategoryIds = getBaseCategoryList
security.declareProtected( Permissions.View, 'getBaseCategoryValueList' ) security.declareProtected( Permissions.View, 'getBaseCategoryValueList' )
def getBaseCategoryValueList(self): def getBaseCategoryValueList(self):
......
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