[Erp5-report] r31505 nicolas.dumazet - /erp5/trunk/products/ERP5/Document/Transformation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 29 03:09:00 CET 2009


Author: nicolas.dumazet
Date: Tue Dec 29 03:08:59 2009
New Revision: 31505

URL: http://svn.erp5.org?rev=31505&view=rev
Log:
getVariationCategoryItemList: renderer for category list can be created once

renderer is the same object in each loop step. It can be created once outside
of the loop and reused instead of reinstanciating a new Renderer each time

Modified:
    erp5/trunk/products/ERP5/Document/Transformation.py

Modified: erp5/trunk/products/ERP5/Document/Transformation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Transformation.py?rev=31505&r1=31504&r2=31505&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Transformation.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Transformation.py [utf8] Tue Dec 29 03:08:59 2009
@@ -200,6 +200,12 @@
       if base_category_list == ():
         base_category_list = self.getVariationBaseCategoryList()
 
+      category_renderer = Renderer(
+                             is_right_display=0,
+                             display_none_category=0, base=base,
+                             current_category=current_category,
+                             display_id='logical_path', **kw)
+
       for base_category in base_category_list:
         variation_category_list = self.getVariationCategoryList(
                                             base_category_list=[base_category])
@@ -213,12 +219,9 @@
           else:
             object_list.append(resource)
 
-        variation_category_item_list.extend(Renderer(
-                               is_right_display=0,
-                               display_none_category=0, base=base,
-                               current_category=current_category,
-                               display_id='logical_path',**kw).\
-                                                 render(category_list))
+        variation_category_item_list.extend(category_renderer.\
+                                              render(category_list))
+
         variation_category_item_list.extend(Renderer(
                                is_right_display=0,
                                base_category=base_category,




More information about the Erp5-report mailing list