[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Find/Views/Browser - Find.py:1.1.2.4

Jim Fulton jim@zope.com
Thu, 23 May 2002 14:01:40 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Find/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv26429/lib/python/Zope/App/OFS/Container/Find/Views/Browser

Modified Files:
      Tag: Zope-3x-branch
	Find.py 
Log Message:
This all started with wanting to be able to use url;view in a ZPT path. :)

That lead me to:

- Massive traversal refactoring.

  Namespace handling is now centralized in Zope.App.Traversing. 

- ZPT refactoring, including some renaming that touches pretty much everything. :)

  - The application specific ZPT support was moved into
    Zope.App.PageTemplate. 

  - To get page template files (for use in views):

    from Zope.App.PageTemplate import ViewPageTemplateFile

  - Fixed up security so that ZPT expressions only have access to 
    safe builtins and so that modules namespace does imports safely.

  - Got ZPTPage working!

- renaming url to absolute_url and got absolute_url to work in paths.

- Cleaned up the (as yet unused) RestrictedInterpreter module in
  Zope.Security. In particular, changed to use a separate
  RestrictedBuiltins module.



=== Zope3/lib/python/Zope/App/OFS/Container/Find/Views/Browser/Find.py 1.1.2.3 => 1.1.2.4 ===
 
 from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
-from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
+from Zope.App.PageTemplate import ViewPageTemplateFile
 from Zope.App.OFS.Container.Find.IFind import IFind
 # XXX this needs to be looked up in a registry
 from Zope.App.OFS.Container.Find.FindAdapter import SimpleIdFindFilter
@@ -33,7 +33,7 @@
     def getContext(self):
         return self._context
     
-    index = PageTemplateFile('find.pt')
+    index = ViewPageTemplateFile('find.pt')
 
     def setViewRequest(self, request):
         self._request = request
@@ -50,7 +50,7 @@
         result = []
         for object in finder.find([SimpleIdFindFilter(ids)]):
             id = getId(object)
-            url = str(getRequestView(object, 'url', request))
+            url = str(getRequestView(object, 'absolute_url', request))
             result.append({ 'id': id, 'url': url})
         return result