[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - ViewService.py:1.1.2.9

Kapil k_vertigo@yahoo.com
Sat, 9 Feb 2002 11:22:29 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture
In directory cvs.zope.org:/tmp/cvs-serv15207

Modified Files:
      Tag: Zope-3x-branch
	ViewService.py 
Log Message:
getRequestView now checks for a method setViewRequest upon the view, and 
calls it with the request if present



=== Zope3/lib/python/Zope/ComponentArchitecture/ViewService.py 1.1.2.8 => 1.1.2.9 ===
         skin = request.getViewSkin()
 
-        return self.getView(object, name, type, default, skin)
+        view =  self.getView(object, name, type, default, skin)
+
+        setViewRequest = getattr(view, 'setViewRequest', None)
+        
+        if setViewRequest:
+            setViewRequest(request)
+
+        return view
         
         
     def provideView(self, forInterface, name, type, maker, layer=''):