[Erp5-report] r27982 - in /erp5/trunk/bt5/erp5_banking_check: SkinTemplateItem/portal_skins...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jul 7 11:48:11 CEST 2009
Author: aurel
Date: Tue Jul 7 11:48:08 2009
New Revision: 27982
URL: http://svn.erp5.org?rev=27982&view=rev
Log:
optimize fast input render in a dirty way (check the limit manually instead of using the catalog)
add a count method on the listbox as we no longer retrieve all listbox's lines
Added:
erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_countCheckbook.xml
Modified:
erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_fastInputForm/listbox.xml
erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.xml
erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_listCheckbook.xml
erp5/trunk/bt5/erp5_banking_check/bt/revision
Modified: erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_fastInputForm/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_fastInputForm/listbox.xml?rev=27982&r1=27981&r2=27982&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_fastInputForm/listbox.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_fastInputForm/listbox.xml [utf8] Tue Jul 7 11:48:08 2009
@@ -365,7 +365,9 @@
</item>
<item>
<key> <string>count_method</string> </key>
- <value> <string></string> </value>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+ </value>
</item>
<item>
<key> <string>css_class</string> </key>
@@ -439,7 +441,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
- <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+ <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
@@ -560,6 +562,22 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
+ <value> <string>ListBox_countCheckbook</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="3" aka="AAAAAAAAAAM=">
+ <pickle>
+ <tuple>
+ <global name="Method" module="Products.Formulator.MethodField"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>method_name</string> </key>
<value> <string>ListBox_listCheckbook</string> </value>
</item>
</dictionary>
Modified: erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.xml?rev=27982&r1=27981&r2=27982&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.xml [utf8] Tue Jul 7 11:48:08 2009
@@ -65,7 +65,9 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string># Look at all items availables for the source and then\n
+ <value> <string encoding="cdata"><![CDATA[
+
+# Look at all items availables for the source and then\n
# display them on a listbox so that the user will be able\n
# to select them\n
from DateTime import DateTime\n
@@ -102,6 +104,9 @@
current_tracking_list = getCurrentTrackingList(to_date=at_date,\n
node=node,\n
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")\n
+\n
+ if count is True:\n
+ return len(current_tracking_list)\n
\n
for item in current_tracking_list:\n
item = item.getObject()\n
@@ -136,18 +141,21 @@
destination_payment_value = item.getDestinationPaymentValue()\n
if destination_payment_value is not None:\n
internal_bank_account_number = destination_payment_value.getInternalBankAccountNumber()\n
- if reference is not None and reference != internal_bank_account_number:\n
+ if reference not in (None, \'\') and reference != internal_bank_account_number:\n
continue\n
item_dict[\'internal_bank_account_number\'] = internal_bank_account_number\n
item_dict[\'account_owner\'] = item.getDestinationPaymentTitle()\n
item_dict[\'recept_date\'] = item.getStartDate()\n
item_dict[\'selection\'] = 0\n
item_dict[\'uid\'] = \'new_%s\' %(item.getUid(),)\n
-\n
listbox.append(item_dict)\n
+ if len(listbox) > limit[0]+limit[1]-1:\n
+ break\n
\n
return listbox\n
-</string> </value>
+
+
+]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
@@ -169,7 +177,7 @@
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string>listbox=None, item_portal_type_list=None,destination_payment=None,model_filter_dict=None,batch_mode=0,simulation_state=None,disable_node=0,at_date=None,reference=None,**kw</string> </value>
+ <value> <string>listbox=None, item_portal_type_list=None,destination_payment=None,model_filter_dict=None,batch_mode=0,simulation_state=None,disable_node=0,at_date=None,reference=None,limit=None,count=False,**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
@@ -197,7 +205,7 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>9</int> </value>
+ <value> <int>11</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
@@ -212,6 +220,8 @@
<string>disable_node</string>
<string>at_date</string>
<string>reference</string>
+ <string>limit</string>
+ <string>count</string>
<string>kw</string>
<string>DateTime</string>
<string>Dummy</string>
@@ -224,6 +234,8 @@
<string>item_list</string>
<string>getCurrentTrackingList</string>
<string>current_tracking_list</string>
+ <string>True</string>
+ <string>len</string>
<string>_getiter_</string>
<string>item</string>
<string>exclude</string>
@@ -235,6 +247,7 @@
<string>_write_</string>
<string>destination_payment_value</string>
<string>internal_bank_account_number</string>
+ <string>_getitem_</string>
</tuple>
</value>
</item>
@@ -256,6 +269,8 @@
<int>0</int>
<none/>
<none/>
+ <none/>
+ <int>0</int>
</tuple>
</value>
</item>
Added: erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_countCheckbook.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_countCheckbook.xml?rev=27982&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_countCheckbook.xml (added)
+++ erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_countCheckbook.xml [utf8] Tue Jul 7 11:48:08 2009
@@ -1,0 +1,183 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Python_magic</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string># Look at all items availables for the source and then\n
+# display them on a listbox so that the user will be able\n
+# to select them\n
+request = context.REQUEST\n
+item_portal_type_list = ["Checkbook","Check"]\n
+node = context.getBaobabSource()\n
+\n
+fast_input_type = getattr(request, \'your_fast_input_type\', None)\n
+if fast_input_type is None:\n
+ fast_input_type = getattr(request, \'field_your_fast_input_type\')\n
+\n
+disable_node = 0\n
+at_date = context.getStartDate()\n
+\n
+if fast_input_type == \'traveler_check_purchase\':\n
+ item_portal_type_list = (\'Check\',)\n
+ disable_node = 1\n
+\n
+nb = context.Delivery_getCheckbookList(\n
+ item_portal_type_list=item_portal_type_list,\n
+ disable_node=disable_node,\n
+ at_date=at_date,\n
+ node=node,\n
+ count=True)\n
+\n
+return [[nb,],]\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>*args, **kw</string> </value>
+ </item>
+ <item>
+ <key> <string>errors</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_code</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>co_argcount</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>args</string>
+ <string>kw</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>request</string>
+ <string>item_portal_type_list</string>
+ <string>node</string>
+ <string>getattr</string>
+ <string>None</string>
+ <string>fast_input_type</string>
+ <string>disable_node</string>
+ <string>at_date</string>
+ <string>True</string>
+ <string>nb</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>ListBox_countCheckbook</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_listCheckbook.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_listCheckbook.xml?rev=27982&r1=27981&r2=27982&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_listCheckbook.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/ListBox_listCheckbook.xml [utf8] Tue Jul 7 11:48:08 2009
@@ -68,17 +68,15 @@
<value> <string># Look at all items availables for the source and then\n
# display them on a listbox so that the user will be able\n
# to select them\n
-from DateTime import DateTime\n
request = context.REQUEST\n
item_portal_type_list = ["Checkbook","Check"]\n
node = context.getBaobabSource()\n
-#item_portal_type_list = request.get(\'item_portal_type_list\', ["Checkbook","Check"])\n
-#node = request.get(\'node\', request.get(\'vault\', context.getBaobabSource()))\n
destination_payment = request.get(\'destination_payment\', None)\n
-reference_date = DateTime()\n
-item_list = []\n
-listbox = []\n
-invalid_check_state_list = (\'draft\', \'confirmed\')\n
+\n
+# retrieve listbox limit\n
+nb_lines = int(kw.get(\'list_lines\'))\n
+limit_start = int(kw.get(\'list_start\'))\n
+limit = limit_start, nb_lines\n
\n
simulation_state = None\n
model_filter_dict = {}\n
@@ -86,6 +84,7 @@
if fast_input_type is None:\n
fast_input_type = getattr(request, \'field_your_fast_input_type\')\n
\n
+# retrieve reference field to filter list\n
reference = getattr(request, \'your_reference\', None)\n
if reference is None:\n
reference = getattr(request, \'field_your_reference\', None)\n
@@ -120,8 +119,8 @@
disable_node=disable_node,\n
at_date=at_date,\n
node=node,\n
- reference=reference)\n
-\n
+ reference=reference,\n
+ limit=limit)\n
context.Base_updateDialogForm(listbox=listbox)\n
\n
return context.ListBox_initializeFastInput()\n
@@ -175,7 +174,6 @@
<tuple>
<string>args</string>
<string>kw</string>
- <string>DateTime</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
@@ -183,10 +181,10 @@
<string>node</string>
<string>None</string>
<string>destination_payment</string>
- <string>reference_date</string>
- <string>item_list</string>
- <string>listbox</string>
- <string>invalid_check_state_list</string>
+ <string>int</string>
+ <string>nb_lines</string>
+ <string>limit_start</string>
+ <string>limit</string>
<string>simulation_state</string>
<string>model_filter_dict</string>
<string>getattr</string>
@@ -195,6 +193,7 @@
<string>disable_node</string>
<string>at_date</string>
<string>_write_</string>
+ <string>listbox</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_banking_check/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/bt/revision?rev=27982&r1=27981&r2=27982&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/bt/revision [utf8] Tue Jul 7 11:48:08 2009
@@ -1,1 +1,1 @@
-426
+428
More information about the Erp5-report
mailing list