Removed base content renderer attributes and methods inherited from BaseContentProvider
--- a/src/pyams_default_theme/features/renderer/__init__.py Tue Dec 25 16:04:59 2018 +0100
+++ b/src/pyams_default_theme/features/renderer/__init__.py Thu Dec 27 16:26:51 2018 +0100
@@ -17,23 +17,21 @@
from pyams_content.features.renderer import IContentRenderer, IRenderedContent, IRendererSettings
from pyams_content.features.renderer.interfaces import HIDDEN_RENDERER_NAME
+from pyams_default_theme import _
from pyams_i18n.interfaces import II18n
from pyams_skin.layer import IPyAMSLayer
-from pyams_template.template import get_view_template
-from pyams_utils.adapter import ContextRequestAdapter, adapter_config
-
-from pyams_default_theme import _
+from pyams_utils.adapter import adapter_config
+from pyams_viewlet.viewlet import BaseContentProvider
@implementer(IContentRenderer)
-class BaseContentRenderer(ContextRequestAdapter):
+class BaseContentRenderer(BaseContentProvider):
"""Base content renderer"""
label = None
weight = 0
settings_interface = None
- resources = ()
language = None
context_attrs = ()
@@ -46,8 +44,7 @@
return IRendererSettings(self.context)
def update(self):
- for resource in self.resources:
- resource.need()
+ super(BaseContentRenderer, self).update()
for attr in self.context_attrs:
setattr(self, attr, getattr(self.context, attr, None))
if self.i18n_context_attrs:
@@ -56,8 +53,6 @@
for attr in self.i18n_context_attrs:
setattr(self, attr, i18n.query_attribute(attr, lang=self.language, request=self.request))
- render = get_view_template()
-
@adapter_config(name=HIDDEN_RENDERER_NAME, context=(IRenderedContent, IPyAMSLayer), provides=IContentRenderer)
class HiddenContentRenderer(BaseContentRenderer):