[Erp5-report] r24744 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Nov 28 16:41:37 CET 2008
Author: romain
Date: Fri Nov 28 16:41:36 2008
New Revision: 24744
URL: http://svn.erp5.org?rev=24744&view=rev
Log:
When searching subobject, be sure that context is a parent container.
Unify both query to prevent retrieving the same object twice.
Thanks to Łukasz Nowak for his contribution.
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getRelatedDocumentList.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getRelatedDocumentList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getRelatedDocumentList.xml?rev=24744&r1=24743&r2=24744&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getRelatedDocumentList.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getRelatedDocumentList.xml [utf8] Fri Nov 28 16:41:36 2008
@@ -53,20 +53,18 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>portal = context.getPortalObject()\n
-portal_catalog = portal.portal_catalog\n
-path = "%" + "%s" % (context.getRelativeUrl()) + "%"\n
-\n
+ <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
\n
-document_in_entity_list = portal_catalog(path=path , portal_type=portal_type)\n
-\n
-follow_up_document_list = portal_catalog(portal_type=portal_type,\n
- follow_up_uid=context.getUid())\n
-\n
-return list(document_in_entity_list)+list(follow_up_document_list)\n
+return context.portal_catalog(\n
+ portal_type=portal_type,\n
+ query=query)\n
</string> </value>
</item>
<item>
@@ -105,14 +103,12 @@
<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>portal</string>
- <string>portal_catalog</string>
- <string>path</string>
- <string>document_in_entity_list</string>
- <string>follow_up_document_list</string>
- <string>list</string>
+ <string>query</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=24744&r1=24743&r2=24744&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Fri Nov 28 16:41:36 2008
@@ -1,1 +1,1 @@
-1030
+1031
More information about the Erp5-report
mailing list