Moved adapter registration from pyams_base package
authorThierry Florac <thierry.florac@onf.fr>
Wed, 07 Oct 2015 17:47:36 +0200
changeset 48 8d0e2e33ae90
parent 47 2b580a3b2142
child 49 01eaa997a5f4
Moved adapter registration from pyams_base package
src/pyams_utils/include.py
--- a/src/pyams_utils/include.py	Wed Oct 07 17:46:56 2015 +0200
+++ b/src/pyams_utils/include.py	Wed Oct 07 17:47:36 2015 +0200
@@ -16,7 +16,9 @@
 # import standard library
 
 # import interfaces
+from persistent.interfaces import IPersistent
 from zope.annotation.interfaces import IAttributeAnnotatable, IAnnotations
+from zope.keyreference.interfaces import IKeyReference
 
 # import packages
 from chameleon import PageTemplateFile
@@ -27,6 +29,7 @@
 from pyams_utils.traversing import NamespaceTraverser
 from z3c.pt.pagetemplate import PageTemplateFile as Z3cPageTemplateFile
 from zope.annotation.attribute import AttributeAnnotations
+from zope.keyreference.persistent import KeyReferenceToPersistent
 
 
 def include_package(config):
@@ -50,6 +53,7 @@
 
     # load registry components
     config.registry.registerAdapter(AttributeAnnotations, (IAttributeAnnotatable, ), IAnnotations)
+    config.registry.registerAdapter(KeyReferenceToPersistent, (IPersistent, ), IKeyReference)
 
     try:
         import pyams_zmi