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

Added comments related to the use of aq_parent

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12071 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eb1c596b
......@@ -85,7 +85,13 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
security.declareProtected(Permissions.AccessContentsInformation, 'getCategoryParentUidList')
def getCategoryParentUidList(self, relative_url, base_category = None, strict=0):
"""
Returns the uids of all categories provided in categories
Returns the uids of all categories provided in categorie. This
method can support relative_url such as site/group/a/b/c which
base category is site yet use categories defined in group.
It is also able to use acquisition to create complex categories
such as site/group/a/b/c/b1/c1 where b and b1 are both children
categories of a.
relative_url -- a single relative url of a list of
relative urls
......@@ -114,7 +120,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
# ie. when some documents act as categories
if not strict:
while o.meta_type == 'ERP5 Category' or o.meta_type == 'CMF Category':
o = o.aq_parent
o = o.aq_parent # We want acquisition here without aq_inner
uid_dict[(o.getUid(), bo_uid, 0)] = 1 # Non strict
except (TypeError, KeyError):
LOG('WARNING: CategoriesTool',0, 'Unable to find uid for %s' % path)
......
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