On 2009-06-17, Martin Aspeli <[email protected]> wrote: > REQUEST is a Zope2-ism. When you do self.REQUEST somewhere, you are > actually using acquisition to get this object from the outermost item in > any (most?) acquisition chain: a magic RequestContainer class whose > purpose it is to let you acquire a REQUEST. > > In general, this is a bit icky. You probably should avoid it. > > self.request is not generally available. Rather, it's the most commonly > used name for the request stored on an attribute in a view or viewlet. > These are initialised with a context and a request (and view and viewlet > manager in the case of a viewlet), and normally store those as > self.context and self.request. > > In Zope 2, your views *also* support acquisition, because until Zope > 2.12 at least, they have to in order to have security. So you can do > self.REQUEST on the view, which acquires it from a parent. But this is > magic and you shouldn't do it if you can avoid it.
Good explanation, thanks! So in Zope 2.12 we get "z3 style" security? > > Martin > -- Alex Clark ยท http://aclark.net Buy Practical Plone 3: http://tinyurl.com/practical-plone _______________________________________________ Zope-Dev maillist - [email protected] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
