--- a/src/pyams_catalog/utils.py Wed Jul 12 11:38:51 2017 +0200
+++ b/src/pyams_catalog/utils.py Wed Jul 12 11:39:41 2017 +0200
@@ -19,13 +19,21 @@
# import interfaces
from hypatia.interfaces import ICatalog
+from pyams_utils.interfaces import IKeyValue
from zope.intid.interfaces import IIntIds
# import packages
+from pyams_utils.adapter import adapter_config
from pyams_utils.registry import query_utility
from zope.keyreference.interfaces import NotYet
+@adapter_config(context=ICatalog, provides=IKeyValue)
+def catalog_key_adapter(obj):
+ """Catalog key value adapter"""
+ return str(frozenset(obj))
+
+
def index_object(obj, catalog, ignore_notyet=False):
"""Index given object into catalog"""
logger.debug("Indexing object {0!r}".format(obj))