Commit 9e31b651 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Removed getTitle (acquisition will be used).

Added getCategoryChildLogicalPathItemList and fixed getCategoryChildItemList calls.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1343 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eed7b1ac
...@@ -147,16 +147,18 @@ class Category(Folder): ...@@ -147,16 +147,18 @@ class Category(Folder):
return meta_types return meta_types
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getTitle') 'getLogicalPath')
def getTitle(self): def getLogicalPath(self):
""" """
Returns title is not empty or relative_url Returns logical path, starting under base category.
""" """
title = getattr(self, 'title', '') objectlist = []
if title != '' and title is not None: base = self.getBaseCategory()
return title current = self
else: while not current is base :
return self.getCategoryRelativeUrl() objectlist.insert(0, current)
current = aq_parent(current)
return '/'.join([object.getTitle() for object in objectlist])
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getCategoryChildValueList') 'getCategoryChildValueList')
...@@ -204,7 +206,16 @@ class Category(Folder): ...@@ -204,7 +206,16 @@ class Category(Folder):
Returns a list of tuples by parsing recursively all categories in a Returns a list of tuples by parsing recursively all categories in a
given list of base categories. Uses getTitle as default method given list of base categories. Uses getTitle as default method
""" """
return self.getCategoryChildItemList(recursive = recursive, display_id='getTitle', base=base, **kw) return self.getCategoryChildItemList(recursive = recursive, display_id='title', base=base, **kw)
security.declareProtected(Permissions.AccessContentsInformation,
'getCategoryChildLogicalPathItemList')
def getCategoryChildLogicalPathItemList(self, recursive=1, base=0, **kw):
"""
Returns a list of tuples by parsing recursively all categories in a
given list of base categories. Uses getLogicalPath as default method
"""
return self.getCategoryChildItemList(recursive = recursive, display_id='logical_path', base=base, **kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getCategoryChildIdItemList') 'getCategoryChildIdItemList')
...@@ -213,7 +224,7 @@ class Category(Folder): ...@@ -213,7 +224,7 @@ class Category(Folder):
Returns a list of tuples by parsing recursively all categories in a Returns a list of tuples by parsing recursively all categories in a
given list of base categories. Uses getId as default method given list of base categories. Uses getId as default method
""" """
return self.getCategoryChildItemList(recursive = recursive, display_id='getId', base=base, **kw) return self.getCategoryChildItemList(recursive = recursive, display_id='id', base=base, **kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
......
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