[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate - SimpleViewClass.py:1.1.2.5

Jim Fulton jim@zope.com
Thu, 14 Feb 2002 20:31:12 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	SimpleViewClass.py 
Log Message:
Changed to actually have a index.html page. This was needed to have
consistent base hrefs in view templates, which was necessary to keep
tab declarations simple.

Also made the index attributes public, so that magic security
declarations wouldn't be necessary. This necesitated adding
Zope.Public support.


=== Zope3/lib/python/Zope/PageTemplate/SimpleViewClass.py 1.1.2.4 => 1.1.2.5 ===
 
     def browser_default(self, request):
-        return self.index, ()
+        return self, ('index.html',)
+
+    def browser_traverse(self, request, name):
+        if name == 'index.html':
+            return self.index
+        
+        raise NotFound(self, name, request)
+
 
     # XXX: we need some unittests for this !!!
     def __getitem__(self, name):
         return self.index.macros[name]
 
-    def __call__(self,*args,**kw):
-        return self.index(*args,**kw)
-
+    def __call__(self, REQUEST, *args, **kw):
+        return self.index(REQUEST, *args, **kw)
 
 def SimpleViewClass(src, offering=None, used_for=None):
     if offering is None:
@@ -47,5 +53,6 @@
         if used_for is not None: __used_for__ = used_for
         
         index=PageTemplateFile(src, offering)
+        index.__permission__ = 'Zope.Public'
 
     return C