src/pyams_content/shared/view/interfaces/__init__.py
changeset 337 9a3e4f9cc8f5
parent 96 120f7842a8cb
child 382 f6b688877716
--- a/src/pyams_content/shared/view/interfaces/__init__.py	Fri Jan 26 16:42:19 2018 +0100
+++ b/src/pyams_content/shared/view/interfaces/__init__.py	Fri Jan 26 16:43:14 2018 +0100
@@ -73,6 +73,8 @@
                 description=_("Maximum number of results that the view may retrieve"),
                 required=False)
 
+    is_using_context = Attribute("Check if view is using context settings")
+
     def get_results(self, context):
         """Get results of catalog query"""
 
@@ -81,6 +83,12 @@
     """Workflow managed view interface"""
 
 
+class IViewSettings(Interface):
+    """Base interface for view settings adapters"""
+
+    is_using_context = Attribute("Check if view settings are using context")
+
+
 class IViewQuery(Interface):
     """View query interface"""
 
@@ -128,7 +136,7 @@
                                                 for v, t in REFERENCES_MODES.items()])
 
 
-class IViewInternalReferencesSettings(IInternalReferencesList):
+class IViewInternalReferencesSettings(IViewSettings, IInternalReferencesList):
     """View internal references settings"""
 
     references_mode = Choice(title=_("Internal references usage"),
@@ -141,7 +149,7 @@
 VIEW_THEMES_SETTINGS_KEY = 'pyams_content.view.themes'
 
 
-class IViewThemesSettings(Interface):
+class IViewThemesSettings(IViewSettings):
     """View themess ettings"""
 
     select_context_themes = Bool(title=_("Select context themes?"),