--- a/src/pyams_viewlet/viewlet.py Fri Dec 07 14:23:26 2018 +0100
+++ b/src/pyams_viewlet/viewlet.py Thu Dec 27 16:27:38 2018 +0100
@@ -12,22 +12,19 @@
__docformat__ = 'restructuredtext'
-
-# import standard packages
import logging
-logger = logging.getLogger('PyAMS (viewlet)')
import venusian
-
-# import interfaces
-from pyams_viewlet.interfaces import IViewlet, IViewletManager
+from pyramid.exceptions import ConfigurationError
from pyramid.interfaces import IRequest, IView
from zope.contentprovider.interfaces import IContentProvider
+from zope.interface import Interface, implementer
-# import packages
from pyams_template.template import get_view_template
-from pyramid.exceptions import ConfigurationError
-from zope.interface import implementer, Interface
+from pyams_viewlet.interfaces import IViewlet, IViewletManager
+
+
+logger = logging.getLogger('PyAMS (viewlet)')
@implementer(IContentProvider)
@@ -56,6 +53,12 @@
class BaseContentProvider(EmptyContentProvider):
"""Base template based content provider"""
+ resources = ()
+
+ def update(self):
+ for resource in self.resources:
+ resource.need()
+
render = get_view_template()