[Zope3-checkins] CVS: Zope3/src/zope/component - __init__.py:1.28 interfaces.py:1.29 presentation.py:1.11

Jim Fulton jim at zope.com
Wed Mar 31 18:26:56 EST 2004


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

Modified Files:
	__init__.py interfaces.py presentation.py 
Log Message:
Rearranged the signatures of getMultiView and queryMultiView by moving
the name argument after the providing argument and making the name
optional. This makes multi-views more adapter-like. Multi-view lookup
by interface will be much more common than lookup by name (or name and
interfaace).


=== Zope3/src/zope/component/__init__.py 1.27 => 1.28 ===
--- Zope3/src/zope/component/__init__.py:1.27	Sun Mar 28 18:42:23 2004
+++ Zope3/src/zope/component/__init__.py	Wed Mar 31 18:26:25 2004
@@ -213,21 +213,20 @@
 
 queryView = hookable(queryView)
 
-def getMultiView(objects, name, request, providing=Interface, context=None):
-    view = queryMultiView(objects, name, request, context=context,
-                          providing=providing)
+def getMultiView(objects, request, providing=Interface, name='', context=None):
+    view = queryMultiView(objects, request, providing, name, context=context)
     if view is not None:
         return view
 
     raise ComponentLookupError("Couldn't find view",
                                name, object, context, request)
 
-def queryMultiView(objects, name, request, providing=Interface,
+def queryMultiView(objects, request, providing=Interface, name='',
                    default=None, context=None):
     if context is None:
         context = objects[0]
     s = getService(context, Presentation)
-    return s.queryMultiView(objects, name, request, providing, default)
+    return s.queryMultiView(objects, request, providing, name, default)
 
 def getViewProviding(object, providing, request, context=None):
     return getView(object, '', request, context, providing)


=== Zope3/src/zope/component/interfaces.py 1.28 => 1.29 ===
--- Zope3/src/zope/component/interfaces.py:1.28	Thu Mar 18 11:08:52 2004
+++ Zope3/src/zope/component/interfaces.py	Wed Mar 31 18:26:25 2004
@@ -240,7 +240,7 @@
         a context.
         """
 
-    def getMultiView(objects, name, request, providing=Interface,
+    def getMultiView(objects, request, providing=Interface, name='',
                      context=None):
         """Look for a multi-view for given objects
 
@@ -253,7 +253,7 @@
         to specify a context.
         """
 
-    def queryMultiView(objects, name, request, providing=Interface,
+    def queryMultiView(objects, request, providing=Interface, name='',
                        default=None, context=None):
         """Look for a multi-view for given objects
 
@@ -541,7 +541,7 @@
         The default will be returned if the component can't be found.
         """
 
-    def queryMultiView(objects, name, request, providing=Interface,
+    def queryMultiView(objects, request, providing=Interface, name='',
                        default=None):
         """Adapt the given objects and request
 


=== Zope3/src/zope/component/presentation.py 1.10 => 1.11 ===
--- Zope3/src/zope/component/presentation.py:1.10	Tue Mar 23 17:07:58 2004
+++ Zope3/src/zope/component/presentation.py	Wed Mar 31 18:26:25 2004
@@ -378,8 +378,9 @@
         return default
         
 
-    def queryMultiView(self, objects, name, request,
-                       providing=zope.interface.Interface, default=None):
+    def queryMultiView(self, objects, request,
+                       providing=zope.interface.Interface, name='',
+                       default=None):
         """Adapt the given objects and request
 
         The first argument is a sequence of objects to be adapted with the




More information about the Zope3-Checkins mailing list