[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - metadirectives.py:1.17 viewmeta.py:1.42

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


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv2079/src/zope/app/publisher/browser

Modified Files:
	metadirectives.py viewmeta.py 
Log Message:
No-longer support multi-views for browser:view.
If you want browser multi-views, use zope:view.


=== Zope3/src/zope/app/publisher/browser/metadirectives.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/publisher/browser/metadirectives.py:1.16	Mon Mar 15 15:42:16 2004
+++ Zope3/src/zope/app/publisher/browser/metadirectives.py	Thu Mar 18 07:19:24 2004
@@ -37,6 +37,11 @@
     traversing to the view name and then traversing to the page name.
     """
 
+    for_ = GlobalObject(
+        title=u"The interface this view is for.",
+        required=False
+        )
+
     name = TextLine(
         title=u"The name of the view.",
         description=u"The name shows up in URLs/paths. For example 'foo'.",


=== Zope3/src/zope/app/publisher/browser/viewmeta.py 1.41 => 1.42 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.41	Mon Mar 15 15:42:18 2004
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py	Thu Mar 18 07:19:25 2004
@@ -171,7 +171,7 @@
     _handle_allowed_attributes(_context, allowed_interface, permission,
                                required)
 
-    _handle_for(_context, [for_])
+    _handle_for(_context, for_)
 
     defineChecker(new_class, Checker(required))
 
@@ -239,7 +239,7 @@
                  menu=None, title=None, usage=u'', provides=Interface,
                  ):
 
-        _handle_menu(_context, menu, title, for_, name, permission)
+        _handle_menu(_context, menu, title, [for_], name, permission)
 
         permission = _handle_permission(_context, permission)
 
@@ -372,15 +372,12 @@
                 args = ('', self.provides)
                 )
 
-            
-
-
         _context.action(
-            discriminator = ('view', tuple(for_), name, IBrowserRequest, layer,
+            discriminator = ('view', for_, name, IBrowserRequest, layer,
                              self.provides),
             callable = handler,
             args = (zapi.servicenames.Presentation, 'provideAdapter',
-                    IBrowserRequest, newclass, name, for_,  self.provides,
+                    IBrowserRequest, newclass, name, [for_],  self.provides,
                     layer),
             )
 
@@ -472,13 +469,12 @@
     view.usage = usage
 
 def _handle_for(_context, for_):
-    for iface in for_:
-        if iface is not None:
-            _context.action(
-                discriminator = None,
-                callable = provideInterface,
-                args = ('', iface)
-                )        
+    if for_ is not None:
+        _context.action(
+            discriminator = None,
+            callable = provideInterface,
+            args = ('', for_)
+            )        
 
 class simple(BrowserView):
     implements(IBrowserPublisher)




More information about the Zope3-Checkins mailing list