Commit 6d5bbef5 authored by Jean-Paul Smets's avatar Jean-Paul Smets

2006-01-18 JPS - support of group_by

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12143 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9b7f4801
......@@ -100,11 +100,11 @@ language = portal.Localizer.get_selected_language()\n
\n
# Search the catalog for all documents matching the reference\n
# this will only return documents which are accessible by the user\n
web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_list, \n
order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')],\n
language=language)\n
# XXX - group_by is missing here\n
# portal_catalog extension required\n
web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_list,\n
language=language,\n
order_by=[(\'version\', \'descending\')],\n
group_by=(\'reference\',))\n
\n
try:\n
# Try to get the first page on the list\n
web_page = web_page_list[0]\n
......@@ -112,9 +112,8 @@ try:\n
except IndexError:\n
# Search again without the language\n
web_page_list = portal_catalog(reference=name, portal_type=\'Web Page\', \n
order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')])\n
# XXX - group_by is missing here\n
# portal_catalog extension required\n
order_by=[(\'version\', \'descending\')],\n
group_by=(\'reference\',))\n
try:\n
# Try to get the first page on the list\n
web_page = web_page_list[0]\n
......@@ -205,6 +204,10 @@ return web_page\n
<key> <string>id</string> </key>
<value> <string>WebSection_getDocumentValue</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
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