Commit c60346e4 authored by Jérome Perrin's avatar Jérome Perrin

this use of query is not supported, make two catalog calls for now

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26200 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9602bf7
......@@ -53,18 +53,21 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
# Get The documents in all storage structure. ie.: This scripts get all Files and Images\n
# distributed in many Project Lines in one Project.\n
query = ComplexQuery(\n
Query(relative_url=\'%s/%%\' % context.getRelativeUrl()),\n
Query(follow_up_uid=context.getUid()),\n
operator=\'OR\')\n
<value> <string>sub_document_list = context.portal_catalog(\n
portal_type=portal_type,\n
relative_url=\'%s/%%\' % context.getRelativeUrl())\n
\n
return context.portal_catalog(\n
follow_up_related_document_list = context.portal_catalog(\n
portal_type=portal_type,\n
query=query)\n
follow_up_uid=context.getUid())\n
\n
if not sub_document_list:\n
return follow_up_related_document_list\n
\n
if not follow_up_related_document_list:\n
return sub_document_list\n
\n
return [doc for doc in follow_up_related_document_list] + [doc for doc in sub_document_list]\n
</string> </value>
</item>
<item>
......@@ -103,12 +106,14 @@ return context.portal_catalog(\n
<tuple>
<string>portal_type</string>
<string>kw</string>
<string>Products.ZSQLCatalog.SQLCatalog</string>
<string>Query</string>
<string>ComplexQuery</string>
<string>_getattr_</string>
<string>context</string>
<string>query</string>
<string>sub_document_list</string>
<string>follow_up_related_document_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>doc</string>
</tuple>
</value>
</item>
......
1136
\ No newline at end of file
1137
\ 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