Commit 87d38984 authored by Sebastien Robin's avatar Sebastien Robin

make z_getitem_by_path and z_getitem_by_uid support list of uid or path

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16133 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8f68ecde
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="SQL" module="Products.ZSQLMethods.SQL"/>
<string>Products.ZSQLMethods.SQL</string> <tuple/>
<string>SQL</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -38,6 +35,12 @@ ...@@ -38,6 +35,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>path_list</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>uid_only</string> </key> <key> <string>uid_only</string> </key>
<value> <value>
...@@ -51,8 +54,9 @@ ...@@ -51,8 +54,9 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>path</string> <string>path</string>
<string>uid_only</string> <string>path_list</string>
<string>uid_only</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -69,7 +73,8 @@ ...@@ -69,7 +73,8 @@
</item> </item>
<item> <item>
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string>path\n <value> <string>path\r\n
path_list\r\n
uid_only</string> </value> uid_only</string> </value>
</item> </item>
<item> <item>
...@@ -86,9 +91,7 @@ uid_only</string> </value> ...@@ -86,9 +91,7 @@ uid_only</string> </value>
</item> </item>
<item> <item>
<key> <string>connection_hook</string> </key> <key> <string>connection_hook</string> </key>
<value> <value> <string></string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>connection_id</string> </key> <key> <string>connection_id</string> </key>
...@@ -100,17 +103,27 @@ uid_only</string> </value> ...@@ -100,17 +103,27 @@ uid_only</string> </value>
</item> </item>
<item> <item>
<key> <string>max_cache_</string> </key> <key> <string>max_cache_</string> </key>
<value> <int>100</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>max_rows_</string> </key> <key> <string>max_rows_</string> </key>
<value> <int>10</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>src</string> </key> <key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
select <dtml-if uid_only>uid<dtml-else>*</dtml-if> from catalog where <dtml-sqltest path op=eq type="string"> SELECT <dtml-if uid_only>uid<dtml-else>uid,path</dtml-if> from catalog \n
WHERE \n
1 = 1\n
<dtml-if path>\n
AND <dtml-sqltest path op=eq type="string">\n
</dtml-if>\n
<dtml-if path_list>\n
AND path IN (<dtml-in path_list><dtml-sqlvar sequence-item type="string">\n
<dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>)\n
</dtml-if>\n
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -119,9 +132,11 @@ select <dtml-if uid_only>uid<dtml-else>*</dtml-if> from catalog where <dtml-sqlt ...@@ -119,9 +132,11 @@ select <dtml-if uid_only>uid<dtml-else>*</dtml-if> from catalog where <dtml-sqlt
<value> <value>
<object> <object>
<klass> <klass>
<global name="SQL" module="Shared.DC.ZRDB.DA"/> <global name="__newobj__" module="copy_reg"/>
</klass> </klass>
<none/> <tuple>
<global name="SQL" module="Shared.DC.ZRDB.DA"/>
</tuple>
<state> <state>
<dictionary> <dictionary>
<item> <item>
...@@ -148,7 +163,17 @@ select <dtml-if uid_only>uid<dtml-else>*</dtml-if> from catalog where <dtml-sqlt ...@@ -148,7 +163,17 @@ select <dtml-if uid_only>uid<dtml-else>*</dtml-if> from catalog where <dtml-sqlt
<key> <string>raw</string> </key> <key> <string>raw</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
select <dtml-if uid_only>uid<dtml-else>*</dtml-if> from catalog where <dtml-sqltest path op=eq type="string"> SELECT <dtml-if uid_only>uid<dtml-else>uid,path</dtml-if> from catalog \n
WHERE \n
1 = 1\n
<dtml-if path>\n
AND <dtml-sqltest path op=eq type="string">\n
</dtml-if>\n
<dtml-if path_list>\n
AND path IN (<dtml-in path_list><dtml-sqlvar sequence-item type="string">\n
<dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>)\n
</dtml-if>\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="SQL" module="Products.ZSQLMethods.SQL"/>
<string>Products.ZSQLMethods.SQL</string> <tuple/>
<string>SQL</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -32,12 +29,24 @@ ...@@ -32,12 +29,24 @@
<key> <string>_data</string> </key> <key> <string>_data</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>path_only</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>uid</string> </key> <key> <string>uid</string> </key>
<value> <value>
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>uid_list</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -45,7 +54,9 @@ ...@@ -45,7 +54,9 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>uid</string> <string>uid</string>
<string>uid_list</string>
<string>path_only</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -62,7 +73,9 @@ ...@@ -62,7 +73,9 @@
</item> </item>
<item> <item>
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string>uid</string> </value> <value> <string>uid\r\n
uid_list\r\n
path_only</string> </value>
</item> </item>
<item> <item>
<key> <string>cache_time_</string> </key> <key> <string>cache_time_</string> </key>
...@@ -78,9 +91,7 @@ ...@@ -78,9 +91,7 @@
</item> </item>
<item> <item>
<key> <string>connection_hook</string> </key> <key> <string>connection_hook</string> </key>
<value> <value> <string></string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>connection_id</string> </key> <key> <string>connection_id</string> </key>
...@@ -96,13 +107,23 @@ ...@@ -96,13 +107,23 @@
</item> </item>
<item> <item>
<key> <string>max_rows_</string> </key> <key> <string>max_rows_</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>src</string> </key> <key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
select * from catalog where <dtml-sqltest uid op=eq type="int"> SELECT <dtml-if path_only>path<dtml-else>uid,path</dtml-if> from catalog \n
WHERE \n
1 = 1\n
<dtml-if uid>\n
AND <dtml-sqltest uid op=eq type="int">\n
</dtml-if>\n
<dtml-if uid_list>\n
AND uid IN (<dtml-in uid_list><dtml-sqlvar sequence-item type="int">\n
<dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>)\n
</dtml-if>\n
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -111,9 +132,11 @@ select * from catalog where <dtml-sqltest uid op=eq type="int"> ...@@ -111,9 +132,11 @@ select * from catalog where <dtml-sqltest uid op=eq type="int">
<value> <value>
<object> <object>
<klass> <klass>
<global name="SQL" module="Shared.DC.ZRDB.DA"/> <global name="__newobj__" module="copy_reg"/>
</klass> </klass>
<none/> <tuple>
<global name="SQL" module="Shared.DC.ZRDB.DA"/>
</tuple>
<state> <state>
<dictionary> <dictionary>
<item> <item>
...@@ -140,7 +163,17 @@ select * from catalog where <dtml-sqltest uid op=eq type="int"> ...@@ -140,7 +163,17 @@ select * from catalog where <dtml-sqltest uid op=eq type="int">
<key> <string>raw</string> </key> <key> <string>raw</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
select * from catalog where <dtml-sqltest uid op=eq type="int"> SELECT <dtml-if path_only>path<dtml-else>uid,path</dtml-if> from catalog \n
WHERE \n
1 = 1\n
<dtml-if uid>\n
AND <dtml-sqltest uid op=eq type="int">\n
</dtml-if>\n
<dtml-if uid_list>\n
AND uid IN (<dtml-in uid_list><dtml-sqlvar sequence-item type="int">\n
<dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>)\n
</dtml-if>\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
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