Added base interface for content's portal context
authorThierry Florac <thierry.florac@onf.fr>
Wed, 11 Jul 2018 15:10:57 +0200
changeset 831 4202a94629c6
parent 830 ea722c2352b7
child 832 54e1fc14724b
Added base interface for content's portal context
src/pyams_content/shared/common/interfaces/__init__.py
src/pyams_content/shared/common/portal.py
--- a/src/pyams_content/shared/common/interfaces/__init__.py	Wed Jul 11 13:36:12 2018 +0200
+++ b/src/pyams_content/shared/common/interfaces/__init__.py	Wed Jul 11 15:10:57 2018 +0200
@@ -166,7 +166,11 @@
                    required=False)
 
 
-class IWfSharedContentPortalContext(IWfSharedContent, IPortalContext):
+class IBaseContentPortalContext(IPortalContext):
+    """Content portal context interface"""
+
+
+class IWfSharedContentPortalContext(IWfSharedContent, IBaseContentPortalContext):
     """Shared content with portal support"""
 
 
--- a/src/pyams_content/shared/common/portal.py	Wed Jul 11 13:36:12 2018 +0200
+++ b/src/pyams_content/shared/common/portal.py	Wed Jul 11 15:10:57 2018 +0200
@@ -16,7 +16,7 @@
 # import standard library
 
 # import interfaces
-from pyams_content.shared.common.interfaces import IBaseSharedTool, IWfSharedContentPortalContext
+from pyams_content.shared.common.interfaces import IBaseSharedTool, IBaseContentPortalContext
 from pyams_portal.interfaces import IPortalPage, PORTAL_PAGE_KEY
 
 # import packages
@@ -37,7 +37,7 @@
         return get_parent(self, IBaseSharedTool, allow_context=False)
 
 
-@adapter_config(context=IWfSharedContentPortalContext, provides=IPortalPage)
+@adapter_config(context=IBaseContentPortalContext, provides=IPortalPage)
 def shared_content_portal_page_adapter(context):
     """Shared content portal page adapter"""
     return get_annotation_adapter(context, PORTAL_PAGE_KEY, SharedContentPortalPage)