src/pyams_utils/zodb.py
changeset 100 119b9c2f3022
parent 72 9049384a2bd4
child 124 53dc81f933ed
--- a/src/pyams_utils/zodb.py	Wed Jul 12 13:55:47 2017 +0200
+++ b/src/pyams_utils/zodb.py	Wed Jul 12 13:56:41 2017 +0200
@@ -17,6 +17,7 @@
 
 # import interfaces
 from persistent.interfaces import IPersistent
+from pyams_utils.interfaces import ICacheKeyValue
 from pyams_utils.interfaces.site import IOptionalUtility
 from pyams_utils.interfaces.zeo import IZEOConnection
 from transaction.interfaces import ITransactionManager
@@ -71,6 +72,11 @@
         # recent spelling.
 
 
+@adapter_config(context=object, provides=ICacheKeyValue)
+def persistent_key_adapter(obj):
+    return '{0!r}'.format(obj)
+
+
 @implementer(IZEOConnection)
 class ZEOConnection(object):
     """ZEO connection object