[Zope-CMF] Adding acquisition containers to a CMF object.

Kent Polk kent@goathill.org
28 Jun 2001 00:57:57 GMT


Due to the way that CMF items are added (specifying only the id),
I've run into a problem... I need to explicitly set the acquisition
path of my object *after* it has been _setObject()ed, since I don't
know at that time what parent object I need to wrap the new object
in (specified via selector list).

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 :^(

I tried using aq_acquire with myparent's id and I get a keyerror
with a null value, so obviously I'm doing something wrong there.

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.

I see references to doing things like this various places, but not
quite in this context (and I can't get the other examples to work
either).

Thanks!