[Zope-CMF] Adding acquisition containers to a CMF object.
Dieter Maurer
dieter@handshake.de
Thu, 28 Jun 2001 22:37:38 +0200 (CEST)
Kent Polk writes:
> I can use self.__of__(myparent) and aq_chain indicates myparent
> has been added to the acquisition chain, but only for the current
> request, and only for the method I call which contains it, which
> isn't of much use :^(
> ....
> So, how do you permanently (explicitly) add to the acquisition path
> after _setObject has been run? And it would be handy to be able to
> change the parent if desired.
Acquisition is *always* bound to a single request.
Traversal (attribute access) of the object hierarchy
creates the acquisition wrappers.
When the request is finished, the acquisition wrappers are
destroyed (the bare objects remain).
You can use "__bobo_traverse__" to customize the traversal
and the build up of the acquisition chain.
See
URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html
You may find relevant information in the Zope Developer Guide, too.
Dieter