[Zope] a question about aq_base

Dieter Maurer dieter at handshake.de
Tue Nov 28 14:45:32 EST 2006


Yuri wrote at 2006-11-28 14:23 +0100:
> here: http://docs.neuroinf.de/programming-plone/ate we can read:
>
> 
>
>        obj = brain.getObject().aq_base
>
>why .aq_base and not only brain.getObject()? :)

Usually, it is a bad idea to use "aq_base" in Zope applications
(there are special cases where it is the right thing though).
The reason: Zope usually expects to work with acquisition wrapped objects.
"aq_base" discards the acquisition context.


You should carefully examine the context of the code fragment above.
Maybe, the context is one of the rare situations where "aq_base"
is called for...



-- 
Dieter


More information about the Zope mailing list