[Zope] Rendering files with exception
Dieter Maurer
dieter@handshake.de
Fri, 5 Jul 2002 20:05:02 +0200
Marius Gedminas writes:
> On Wed, Jul 03, 2002 at 08:05:40PM +0200, Dieter Maurer wrote:
> > If you want to learn more about "aq_explicit", read
> >
> > <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
>
> I couldn't find any mention of aq_explicit there. A google search on
> aq_explicit site:www.dieter.handshake.de found no matches either.
> Grepping around the CVS version of the Zope Book also did not find any
> results.
>
> What am I missing?
Nothing.
Look at section "3.2 Acquisition". You learn their about
"implicit" and "explicit" acquisition wrappers.
"aq_explicit" takes an implicit acquisition wrapper and
returns the corresponding explicit acquisition wrapper,
i.e. the one with the same "aq_self" and "aq_parent".
As the result is an explicit wrapper, attribute lookups
are only performed (automatically) in "aq_self" and
no longer in "aq_parent". This gives you the expected
result as long as "aq_self" is not itself a wrapped object.
In simple case, "aq_self" is not a wrapper, in more complex
cases, it can be, however.
Dieter