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