From 21aaeca84b752819dfde405c08d3cb40f628cc71 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Mon, 21 Sep 2009 15:08:29 +0000
Subject: [PATCH] Performance improvement for ERP5Site_checkDataWithScript

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29127 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_core/ERP5Site_checkDataWithScript.xml   | 4 +++-
 product/ERP5/bootstrap/erp5_core/bt/revision                  | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkDataWithScript.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkDataWithScript.xml
index b48f981e93..b365dc98fd 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkDataWithScript.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkDataWithScript.xml
@@ -111,7 +111,8 @@ if depth == maximum_depth and id_list:\n
 else:\n
   if id_list is None:\n
     if full or not getattr(document, \'isHBTree\', lambda: 0)():\n
-      id_list = document.objectIds()\n
+      #Cast in list to avoid accessing ZODB objects for each iteration\n
+      id_list = list(document.objectIds())\n
       if not depth:\n
         id_list = tuple(x for x in id_list if x.endswith(\'_module\') or x in [\n
           \'portal_alarms\',\n
@@ -213,6 +214,7 @@ else:\n
                             <string>id</string>
                             <string>_getitem_</string>
                             <string>getattr</string>
+                            <string>list</string>
                             <string>tuple</string>
                             <string>DateTime</string>
                             <string>xrange</string>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index 93bf02c8ec..61a41990ac 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-1302
\ No newline at end of file
+1303
\ No newline at end of file
-- 
2.30.9