[Zope-Checkins]
SVN: Zope/branches/philikon-aq/lib/python/Products/Five/
Removed some more references to Acquisition
Hanno Schlichting
plone at hannosch.info
Sun Jul 29 07:11:28 EDT 2007
Log message for revision 78455:
Removed some more references to Acquisition
Changed:
U Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
U Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt
U Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py
U Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt
U Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py
-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py 2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py 2007-07-29 11:11:27 UTC (rev 78455)
@@ -17,9 +17,7 @@
"""
import zope.app.pagetemplate
-from Acquisition import aq_base
from Acquisition import aq_get
-from Acquisition import aq_parent
from AccessControl import getSecurityManager
from Products.PageTemplates.Expressions import SecureModuleImporter
from Products.PageTemplates.Expressions import createTrustedZopeEngine
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt 2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt 2007-07-29 11:11:27 UTC (rev 78455)
@@ -188,18 +188,15 @@
</body>
</html>
-Now we test a provider using a PageTemplateFile to render itself. It must
-inherit from an Acquisition base class so that the template can use Zope 2
-security mechanisms:
+Now we test a provider using a PageTemplateFile to render itself:
>>> import os, tempfile
>>> temp_dir = tempfile.mkdtemp()
>>> dynTemplate = os.path.join(temp_dir, 'dynamic_template.pt')
>>> open(dynTemplate, 'w').write(
... 'A simple template: <tal:simple replace="python:view.my_property" />')
- >>> from Acquisition import Explicit
>>> from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
- >>> class TemplateProvider(Explicit):
+ >>> class TemplateProvider(object):
... zope.component.adapts(zope.interface.Interface,
... browser.IDefaultBrowserLayer,
... zope.interface.Interface)
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py 2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py 2007-07-29 11:11:27 UTC (rev 78455)
@@ -36,7 +36,7 @@
"""Find a site by walking up the object hierarchy, supporting both
the ``ILocation`` API and Zope 2 Acquisition."""
while obj is not None and not iface.providedBy(obj):
- obj = getattr(obj, '__parent__', aq_parent(aq_inner(obj)))
+ obj = aq_parent(aq_inner(obj))
return obj
@zope.component.adapter(zope.interface.Interface)
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt 2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt 2007-07-29 11:11:27 UTC (rev 78455)
@@ -271,13 +271,6 @@
* They need to be initialized with the Zope 2 security system, as
otherwise you cannot use the view.
-* This also means they need to be part of the Zope 2 acquisition
- system, as this is a requirement for Zope 2 security to
- function. The ``BrowserView`` base class, available from
- ``Products.Five``, already inherits from ``Acquisition.Explicit`` to
- make this be the case. Acquisition is explicit so no attributes can
- be acquired by accident.
-
An example of a simple view::
from Products.Five import BrowserView
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py 2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py 2007-07-29 11:11:27 UTC (rev 78455)
@@ -14,11 +14,9 @@
"""Five-compatible version of ObjectWidget
This is needed because ObjectWidget uses ViewPageTemplateFile whose
-macro definition is unfortunately incompatible with
-ZopeTwoPageTemplateFile. So this subclass uses
-ZopeTwoPageTemplateFile for the template that renders the widget's
-sub-editform. Acquisition has to be mixed in to provide the
-ZopeTwoPageTemplateFile with the proper acquisition context.
+macro definition is unfortunately incompatible with ZopeTwoPageTemplateFile.
+So this subclass uses ZopeTwoPageTemplateFile for the template that renders
+the widget's sub-editform.
$Id$
"""
More information about the Zope-Checkins
mailing list