Added name to portlet renderer settings instances
authorThierry Florac <thierry.florac@onf.fr>
Thu, 04 Oct 2018 16:41:41 +0200
changeset 200 b2bb69f30e67
parent 199 09aaa72ce3bc
child 201 6b6236f258ab
Added name to portlet renderer settings instances
src/pyams_portal/portlet.py
--- a/src/pyams_portal/portlet.py	Fri Sep 28 09:24:42 2018 +0200
+++ b/src/pyams_portal/portlet.py	Thu Oct 04 16:41:41 2018 +0200
@@ -329,7 +329,16 @@
     renderer = context.get_renderer()
     if not renderer.settings_interface:
         return None
-    return get_annotation_adapter(context, renderer.settings_key, renderer.settings_interface)
+    return get_annotation_adapter(context, renderer.settings_key, renderer.settings_interface,
+                                  name='++renderer++')
+
+
+@adapter_config(name='renderer', context=IPortletSettings, provides=ITraversable)
+class PortletSettingsRendererSettingsTraverser(ContextAdapter):
+    """Portlet settings traverser to renderer settings"""
+
+    def traverse(self, name, furtherpath=None):
+        return IPortletRendererSettings(self.context)
 
 
 @implementer(IPortletConfiguration)