[Erp5-report] r12071 - /erp5/trunk/products/ERP5/Tool/CategoryTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Jan 13 18:45:21 CET 2007


Author: jp
Date: Sat Jan 13 18:45:20 2007
New Revision: 12071

URL: http://svn.erp5.org?rev=12071&view=rev
Log:
Added comments related to the use of aq_parent

Modified:
    erp5/trunk/products/ERP5/Tool/CategoryTool.py

Modified: erp5/trunk/products/ERP5/Tool/CategoryTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/CategoryTool.py?rev=12071&r1=12070&r2=12071&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/CategoryTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/CategoryTool.py Sat Jan 13 18:45:20 2007
@@ -85,7 +85,13 @@
     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 @@
                 # 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)




More information about the Erp5-report mailing list