Browser views: inherit from object or BrowserView from Five/Plone
Rocky
rocky at serverzen.com
Sun Apr 22 13:52:12 UTC 2007
On Apr 18, 6:17 pm, Martin Aspeli <optil... at gmx.net> wrote:
> Come to think of it, Five's implementation of the <browser:page />
> directive injects its BrowserView class as a base class of your class.
> This is bad voodoo magic, though. It's going to happen. You need it. So
> be explicit about it. :)
Yes/no/maybe. I agree that this directive is probably doing more than
it should be doing. But ... having the magical aq security machinery
work is already fairly implicit in the zope2 world. I typically do
"class MyView(object)" in order to treat it more like an adapter. How
often do you extend conventional base classes when creating new non-
view-style adapters? So in this case Five is injecting things for the
view to behave better on Zope 2 (including allowing security to
work). I don't know... I'm still fairly torn on this issue.
In the meantime, either works.
- Rocky
More information about the Product-Developers
mailing list