Commit 5acbbb09 authored by Nicolas Dumazet's avatar Nicolas Dumazet

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


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31505 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 28269103
...@@ -200,6 +200,12 @@ class Transformation(XMLObject, Predicate, Variated): ...@@ -200,6 +200,12 @@ class Transformation(XMLObject, Predicate, Variated):
if base_category_list == (): if base_category_list == ():
base_category_list = self.getVariationBaseCategoryList() 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: for base_category in base_category_list:
variation_category_list = self.getVariationCategoryList( variation_category_list = self.getVariationCategoryList(
base_category_list=[base_category]) base_category_list=[base_category])
...@@ -213,12 +219,9 @@ class Transformation(XMLObject, Predicate, Variated): ...@@ -213,12 +219,9 @@ class Transformation(XMLObject, Predicate, Variated):
else: else:
object_list.append(resource) object_list.append(resource)
variation_category_item_list.extend(Renderer( variation_category_item_list.extend(category_renderer.\
is_right_display=0, render(category_list))
display_none_category=0, base=base,
current_category=current_category,
display_id='logical_path',**kw).\
render(category_list))
variation_category_item_list.extend(Renderer( variation_category_item_list.extend(Renderer(
is_right_display=0, is_right_display=0,
base_category=base_category, base_category=base_category,
......
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