src/pyams_portal/portlet.py
changeset 159 aa7f59770245
parent 155 901845e10a37
child 181 561b132c6f14
--- a/src/pyams_portal/portlet.py	Fri Jul 20 12:52:19 2018 +0200
+++ b/src/pyams_portal/portlet.py	Sat Jul 21 14:25:53 2018 +0200
@@ -35,6 +35,7 @@
 from pyams_cache.beaker import get_cache
 from pyams_utils.adapter import adapter_config, ContextAdapter, get_adapter_weight, get_annotation_adapter
 from pyams_utils.factory import get_object_factory, is_interface
+from pyams_utils.registry import get_global_registry
 from pyams_utils.request import check_request
 from pyams_utils.vocabulary import vocabulary_config
 from pyams_viewlet.viewlet import ViewContentProvider
@@ -358,6 +359,9 @@
         settings.configuration = self
         self._settings = settings
 
+    def get_portlet(self):
+        return get_global_registry().queryUtility(IPortlet, name=self.portlet_name)
+
     @property
     def can_inherit(self):
         return not IPortalTemplate.providedBy(self.__parent__)