Corrected catalog query
authorThierry Florac <thierry.florac@onf.fr>
Thu, 23 Aug 2018 14:22:45 +0200
changeset 883 731b88c6f23a
parent 882 7c516b95530f
child 884 e8f95dc29dd9
Corrected catalog query
src/pyams_content/shared/common/zmi/reverse.py
--- a/src/pyams_content/shared/common/zmi/reverse.py	Wed Aug 22 13:24:45 2018 +0200
+++ b/src/pyams_content/shared/common/zmi/reverse.py	Thu Aug 23 14:22:45 2018 +0200
@@ -32,7 +32,7 @@
 
 # import packages
 from hypatia.catalog import CatalogQuery
-from hypatia.query import Eq, Or
+from hypatia.query import Eq, Or, Any
 from pyams_catalog.query import CatalogResultSet
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.container import ContainerView
@@ -94,7 +94,7 @@
         catalog = get_utility(ICatalog)
         oid = ISequentialIdInfo(self.context).hex_oid
         params = Or(Eq(catalog['link_reference'], oid),
-                    Eq(catalog['link_references'], oid))
+                    Any(catalog['link_references'], {oid}))
         return unique_iter(map(get_item,
                                CatalogResultSet(CatalogQuery(catalog).query(params,
                                                                             sort_index='modified_date'))))