Commit d9d5c259 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Drop fetch date from activities

   Use recently added API to speed up the rendering.
parent 9da008b1
item_list = None
if message.activity[3:].lower() == "dict":
item_list = context.ActivityTool_zGetDateForSQLDictMessage(uid=str(message.uid))
elif message.activity[3:].lower() == "queue":
item_list = context.ActivityTool_zGetDateForSQLQueueMessage(uid=str(message.uid))
if item_list is not None and len(item_list) == 1:
return item_list[0].date
raise ValueError("Unknown Message Type, so we cannot select proper table %s " % message.activity[3:])
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>_params</string> </key>
<value> <string>message</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityTool_getDateForActivityMessage</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -39,7 +39,11 @@ ...@@ -39,7 +39,11 @@
</item> </item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>Base_doSelect</string> </value> <value> <string></string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -57,7 +61,7 @@ ...@@ -57,7 +61,7 @@
</item> </item>
<item> <item>
<key> <string>enctype</string> </key> <key> <string>enctype</string> </key>
<value> <string></string> </value> <value> <string>application/x-www-form-urlencoded</string> </value>
</item> </item>
<item> <item>
<key> <string>group_list</string> </key> <key> <string>group_list</string> </key>
...@@ -104,11 +108,11 @@ ...@@ -104,11 +108,11 @@
</item> </item>
<item> <item>
<key> <string>name</string> </key> <key> <string>name</string> </key>
<value> <string>ActivityTool_viewActivityList</string> </value> <value> <string>ActivityTool_viewErrorActivityListAsRSS</string> </value>
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</string> </key>
<value> <string>form_list</string> </value> <value> <string>rss_view</string> </value>
</item> </item>
<item> <item>
<key> <string>row_length</string> </key> <key> <string>row_length</string> </key>
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ActivityTool_getDateForActivityMessage(cell)</string> </value> <value> <string>python: cell.date</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
select
date
from
message
where uid = <dtml-sqlvar uid type="int">
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>date</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>d</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>26</int> </value>
</item>
</dictionary>
</list>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid</string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>cmf_activity_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityTool_zGetDateForSQLDictMessage</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
select
date
from
message_queue
where uid = <dtml-sqlvar uid type="int">
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>date</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>d</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>26</int> </value>
</item>
</dictionary>
</list>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid</string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>cmf_activity_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityTool_zGetDateForSQLQueueMessage</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -191,9 +191,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template): ...@@ -191,9 +191,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_upgrader/ERP5Site_upgradeERP5CoreBusinessTemplate', 'slapos_upgrader/ERP5Site_upgradeERP5CoreBusinessTemplate',
'slapos_upgrader/ERP5Site_upgradeUpgraderBusinessTemplate', 'slapos_upgrader/ERP5Site_upgradeUpgraderBusinessTemplate',
'slapos_rss_style/WebSection_getLegacyMessageList', 'slapos_rss_style/WebSection_getLegacyMessageList',
'slapos_administration/ActivityTool_getDateForActivityMessage',
'slapos_administration/ActivityTool_zGetDateForSQLDictMessage',
'slapos_administration/ActivityTool_zGetDateForSQLQueueMessage',
'slapos_administration/Base_checkStoredBrokenState', 'slapos_administration/Base_checkStoredBrokenState',
'slapos_administration/ERP5Site_cleanUnusedSecurityUid', 'slapos_administration/ERP5Site_cleanUnusedSecurityUid',
'slapos_administration/ERP5Site_getSecurityUidStat', 'slapos_administration/ERP5Site_getSecurityUidStat',
......
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