[Erp5-report] r22567 - in /erp5/trunk/bt5/erp5_banking_check: SkinTemplateItem/portal_skins...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jul 18 18:39:06 CEST 2008
Author: vincent
Date: Fri Jul 18 18:39:03 2008
New Revision: 22567
URL: http://svn.erp5.org?rev=22567&view=rev
Log:
Performance improvements:
- DO NOT use getObject to then just get an UID. It is ready to use in SQL result. This saves a roundtrip to ZODB (which can be in a remote ZEO server).
- DO NOT use getXXXUid() to then feed the uid to catalog to get the real object. Uid _has_ been fetched from the actual object in the accessor anyway. So just grab actual objects, and fetch uids from them when needed. This saves a roundtrip (...per iteration !) to catalog.
- Use "IN" instead of "OR" with equality in SQL query (minor improvement compared to the 2 above)
Modified:
erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml
erp5/trunk/bt5/erp5_banking_check/bt/revision
Modified: erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml?rev=22567&r1=22566&r2=22567&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml Fri Jul 18 18:39:03 2008
@@ -68,14 +68,12 @@
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
-current_tracking_list = [x.getObject() for x in context.portal_simulation.getCurrentTrackingList(\n
+aggregate_uid_list = [x.uid for x in context.portal_simulation.getCurrentTrackingList(\n
at_date=at_date, node=node_url,\n
- where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")]\n
-aggregate_uid_list = [x.uid for x in current_tracking_list]\n
+ where_expression="item_catalog.portal_type IN (\'Check\', \'Checkbook\')")]\n
for line in context.getMovementList():\n
- for aggregate_uid in line.getAggregateUidList():\n
- if aggregate_uid not in aggregate_uid_list:\n
- aggregate_value = context.portal_catalog(uid=aggregate_uid)[0].getObject()\n
+ for aggregate_value in line.getAggregateValueList():\n
+ if aggregate_value.getUid() not in aggregate_uid_list:\n
reference = aggregate_value.getReference()\n
if reference is None:\n
reference = \'%s - %s\' % (aggregate_value.getReferenceRangeMin() or \'\', aggregate_value.getReferenceRangeMax() or \'\')\n
@@ -142,11 +140,8 @@
<string>_getattr_</string>
<string>context</string>
<string>x</string>
- <string>current_tracking_list</string>
<string>aggregate_uid_list</string>
<string>line</string>
- <string>aggregate_uid</string>
- <string>_getitem_</string>
<string>aggregate_value</string>
<string>reference</string>
<string>None</string>
Modified: erp5/trunk/bt5/erp5_banking_check/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/bt/revision?rev=22567&r1=22566&r2=22567&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_check/bt/revision Fri Jul 18 18:39:03 2008
@@ -1,1 +1,1 @@
-402
+403
More information about the Erp5-report
mailing list