Commit b88165a3 authored by Ivan Tyagov's avatar Ivan Tyagov

Generate proper portal_type syntax.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38389 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ed77e93e
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -106,10 +103,12 @@ if portal_type_list == \'all\':\n ...@@ -106,10 +103,12 @@ if portal_type_list == \'all\':\n
if isinstance(portal_type_list, str):\n if isinstance(portal_type_list, str):\n
portal_type_list=[portal_type_list]\n portal_type_list=[portal_type_list]\n
if portal_type_list:\n if portal_type_list:\n
if len(portal_type_list)==1:\n portal_type_string_list = []\n
search_string += \' type:"%s"\' % portal_type_list[0]\n for portal_type in portal_type_list:\n
else:\n if \' \' in portal_type:\n
search_string += \' type:(%s)\' %\',\'.join(portal_type_list)\n portal_type = \'"%s"\' %portal_type\n
portal_type_string_list.append(\'portal_type:%s\' %portal_type)\n
search_string += \' %s\' %\' OR \'.join(portal_type_string_list)\n
\n \n
# search by reference\n # search by reference\n
reference = kw.get(\'reference\', request.get(\'reference\', None))\n reference = kw.get(\'reference\', request.get(\'reference\', None))\n
...@@ -212,8 +211,8 @@ return search_string\n ...@@ -212,8 +211,8 @@ return search_string\n
<string>portal_type_list</string> <string>portal_type_list</string>
<string>isinstance</string> <string>isinstance</string>
<string>str</string> <string>str</string>
<string>len</string> <string>portal_type_string_list</string>
<string>_getitem_</string> <string>portal_type</string>
<string>reference</string> <string>reference</string>
<string>version</string> <string>version</string>
<string>language</string> <string>language</string>
...@@ -224,6 +223,7 @@ return search_string\n ...@@ -224,6 +223,7 @@ return search_string\n
<string>newest</string> <string>newest</string>
<string>search_mode</string> <string>search_mode</string>
<string>search_mode_map</string> <string>search_mode_map</string>
<string>_getitem_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
1172 1173
\ No newline at end of file \ No newline at end of file
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