[Erp5-report] r38811 fabien - /erp5/trunk/products/CMFCategory/Category.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 30 16:21:31 CEST 2010


Author: fabien
Date: Thu Sep 30 16:21:30 2010
New Revision: 38811

URL: http://svn.erp5.org?rev=38811&view=rev
Log:
change behavior to fit the doc string :
  base -- a boolean or a string. If it is a string, then use
          that string as a base

before, if it was a string it was never used because the expression 
"if str("something"):" is always True

Modified:
    erp5/trunk/products/CMFCategory/Category.py

Modified: erp5/trunk/products/CMFCategory/Category.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFCategory/Category.py?rev=38811&r1=38810&r2=38811&view=diff
==============================================================================
--- erp5/trunk/products/CMFCategory/Category.py [utf8] (original)
+++ erp5/trunk/products/CMFCategory/Category.py [utf8] Thu Sep 30 16:21:30 2010
@@ -365,7 +365,9 @@ class Category(Folder):
       """
       if not base:
         base = '' # Make sure we get a meaningful base
-      if base:
+      elif isinstance(base, str):
+        base = base + '/'
+      elif base:
         base = self.getBaseCategoryId() + '/' # Make sure we get a meaningful base
       url_list = []
       for value in self.getCategoryChildValueList(recursive=recursive,




More information about the Erp5-report mailing list