From a16017d2c32248d6098917e0e1dd5337710e5899 Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Sat, 13 Jan 2007 17:45:20 +0000 Subject: [PATCH] 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 --- product/ERP5/Tool/CategoryTool.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/product/ERP5/Tool/CategoryTool.py b/product/ERP5/Tool/CategoryTool.py index 1e5616ac6c..c3576ac1f6 100644 --- a/product/ERP5/Tool/CategoryTool.py +++ b/product/ERP5/Tool/CategoryTool.py @@ -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) -- 2.30.9