[Zope3-Users] Re: view vs page confused
Philipp von Weitershausen
philipp at weitershausen.de
Thu Mar 29 16:03:22 EDT 2007
FB wrote:
> On Tue, Mar 27, 2007 at 06:03:54PM +0200, Dominique Lederer wrote:
>> so if i create a class which inherits from BrowserView, and then register it via
>> zcml as browser:page, it becomes adaptes to IBrowserRequest an turns to a
>> BrowserPage (via the on-the-fly created class)? so inheriting from BrowserPage
>> instead from BrowserView would make no sense with my example?
>
> It doesn't event make sense to inherit from BrowserView because a browser:page-registered
> view-class is just a mixin. A class like this is enough:
>
> class MyView(object):
> def mySpecialMethod(self):
> [...]
> [...]
Even though browser:page's magic doesnt' require it, I strongly suggest
to inherit from BrowserView or BrowserPage nonetheless, even if it's
only for documentation purposes... (where are self.request and
self.context coming from, where's browserDefault coming from?)
--
http://worldcookery.com -- Professional Zope documentation and training
More information about the Zope3-users
mailing list