[Zope3-checkins] CVS: Zope3/src/zope/component - __init__.py:1.25 interfaces.py:1.27

Jim Fulton jim at zope.com
Thu Mar 18 07:19:57 EST 2004


Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv2130/src/zope/component

Modified Files:
	__init__.py interfaces.py 
Log Message:
Added queryMultiView


=== Zope3/src/zope/component/__init__.py 1.24 => 1.25 ===
--- Zope3/src/zope/component/__init__.py:1.24	Mon Mar 15 15:42:21 2004
+++ Zope3/src/zope/component/__init__.py	Thu Mar 18 07:19:26 2004
@@ -205,6 +205,13 @@
 
 queryView = hookable(queryView)
 
+def queryMultiView(objects, name, request, providing=Interface,
+                   default=None, context=None):
+    if context is None:
+        context = objects[0]
+    s = getService(context, Presentation)
+    return s.queryMultiView(objects, name, request, providing, default)
+
 def getViewProviding(object, providing, request, context=None):
     return getView(object, '', request, context, providing)
     


=== Zope3/src/zope/component/interfaces.py 1.26 => 1.27 ===
--- Zope3/src/zope/component/interfaces.py:1.26	Mon Mar 15 15:42:25 2004
+++ Zope3/src/zope/component/interfaces.py	Thu Mar 18 07:19:26 2004
@@ -227,6 +227,18 @@
         If context is not specified, attempts to use 
         object to specify a context.
         """
+
+    def queryMultiView(objects, name, request, providing=Interface,
+                       default=None, context=None):
+        """Look for a multi-view for given objects
+
+        The request must implement IPresentationRequest: it provides the view
+        type and the skin name.  The nearest one to the object is
+        found. If a matching view cannot be found, returns default.
+
+        If context is not specified, attempts to use 
+        the first object to specify a context.
+        """
         
     def getViewProviding(object, providing, request, context=None):
         """Look for a view based on the interface it provides.




More information about the Zope3-Checkins mailing list