Make sure that those old aq_* attributes work on browser views that only inherit

from Explicit as well.
parent c5aa30f7
...@@ -32,6 +32,13 @@ class LegacyAttributes(BrowserView): ...@@ -32,6 +32,13 @@ class LegacyAttributes(BrowserView):
def __call__(self): def __call__(self):
return repr([obj for obj in self.aq_chain]) return repr([obj for obj in self.aq_chain])
class ExplicitLegacyAttributes(Acquisition.Explicit):
"""Make sure that those old aq_* attributes work on browser views
that only inherit from Explicit as well."""
def __call__(self):
return repr([obj for obj in self.aq_chain])
class LegacyTemplate(BrowserView): class LegacyTemplate(BrowserView):
template = ViewPageTemplateFile('falcon.pt') template = ViewPageTemplateFile('falcon.pt')
......
...@@ -8,6 +8,13 @@ ...@@ -8,6 +8,13 @@
permission="zope.Public" permission="zope.Public"
/> />
<browser:page
for="*"
name="explicitattributes"
class=".aqlegacy.ExplicitLegacyAttributes"
permission="zope.Public"
/>
<browser:page <browser:page
for="*" for="*"
name="template" name="template"
......
...@@ -26,6 +26,15 @@ views still works (the printed output is the aq_chain of the view): ...@@ -26,6 +26,15 @@ views still works (the printed output is the aq_chain of the view):
<Application at >, <Application at >,
<ZPublisher.BaseRequest.RequestContainer object at ...>] <ZPublisher.BaseRequest.RequestContainer object at ...>]
The same goes for browser views that just mix in Acquisition.Explicit:
>>> browser.open('http://localhost/test_folder_1_/explicitattributes')
>>> print browser.contents
[<Products.Five.metaclass.ExplicitLegacyAttributes object at ...>,
<Folder at /test_folder_1_>,
<Application at >,
<ZPublisher.BaseRequest.RequestContainer object at ...>]
Let's do some more manual tests with the view object. But first we Let's do some more manual tests with the view object. But first we
must get it: must get it:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment