Updated interface description
authorThierry Florac <thierry.florac@onf.fr>
Thu, 12 Jul 2018 11:47:12 +0200
changeset 837 0a517f8ae2b7
parent 836 f33d67c86cdd
child 838 bb0eec4a5689
Updated interface description
src/pyams_content/shared/view/portlet/__init__.py
src/pyams_content/shared/view/portlet/interfaces.py
--- a/src/pyams_content/shared/view/portlet/__init__.py	Wed Jul 11 16:13:25 2018 +0200
+++ b/src/pyams_content/shared/view/portlet/__init__.py	Thu Jul 12 11:47:12 2018 +0200
@@ -50,17 +50,17 @@
     views_merge_mode = FieldProperty(IViewItemsPortletSettings['views_merge_mode'])
     limit = FieldProperty(IViewItemsPortletSettings['limit'])
 
-    def get_merger(self, request=None):
-        if request is None:
-            request = check_request()
-        return request.registry.queryUtility(IViewsMerger, name=self.views_merge_mode)
-
     def get_views(self):
         for oid in self.views or ():
             view = get_sequence_target(oid, state=PUBLISHED_STATES)
             if view is not None:
                 yield view
 
+    def get_merger(self, request=None):
+        if request is None:
+            request = check_request()
+        return request.registry.queryUtility(IViewsMerger, name=self.views_merge_mode)
+
     def get_items(self, request=None, ignore_cache=False):
         if request is None:
             request = check_request()
--- a/src/pyams_content/shared/view/portlet/interfaces.py	Wed Jul 11 16:13:25 2018 +0200
+++ b/src/pyams_content/shared/view/portlet/interfaces.py	Thu Jul 12 11:47:12 2018 +0200
@@ -63,6 +63,9 @@
                                    content_type=WfView.content_type,
                                    required=True)
 
+    def get_views(self):
+        """Get iterator over selected views"""
+
     views_context = Choice(title=_("Views context"),
                            description=_("When searching for items, a view receives a \"context\" which is the object "
                                          "from which settings can be extracted; this context can be the \"display\" "
@@ -82,6 +85,12 @@
                               default=CONCAT_VIEWS_MERGE_MODE,
                               required=True)
 
+    def get_merger(self):
+        """Get selected views merger utility"""
+
     limit = Int(title=_("Results count limit"),
                 description=_("Maximum number of results that the component may extract from merged views"),
                 required=False)
+
+    def get_items(self):
+        """Get iterator over items returned by selected views, using selected merger"""