[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - BaseRequest.py:1.43.4.1

Casey Duncan casey_duncan@yahoo.com
Fri, 14 Dec 2001 00:15:21 -0500


Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv25935

Modified Files:
      Tag: casey-better_put_handling-branch
	BaseRequest.py 
Log Message:
Added support to modify default method name from "index_html"
Now supports object specified default method


=== Zope/lib/python/ZPublisher/BaseRequest.py 1.43 => 1.43.4.1 ===
         parents.append(object)
 
+        # See if the object specifies a different method for
+        # publication (Casey)
+
+        
+
         steps=self.steps
         self._steps = _steps = map(quote, steps)
         path.reverse()
@@ -329,6 +334,14 @@
                 parents.append(object)
 
                 steps.append(entry_name)
+
+                # See if this is the last object in the URL path
+                # and if so, if it specifies the method/view name that
+                # should be published (casey)
+                if not path and hasattr(object, '__default_view_name__'):
+                    method = object.__default_view_name__
+                    if callable(method): 
+                        method = method()
         finally:
             parents.reverse()