[Zope] Instance within Instance

Dieter Maurer dieter@handshake.de
Wed, 29 Nov 2000 00:25:44 +0100 (CET)


Daryl Stultz writes:
 > .... "REQUEST.set" to influence where instance is created ....

"createInObjectManager" is uninterested in "REQUEST".
It creates the new object (usually, exception when its object
has a special "Destination" attribute) in the parent (aq_parent)
of its object.

Your "dtml-with" should place your "class1" instance correctly
in the "parent position".

I expect, that your "class1" does not inherit form "ObjectManager"
and therefore does not have a "_setObject".

In this case, "createInObjectManager" goes up another step
(another "aq_parent") and reaches the folder containing
the "class1" instance.
It has a "_setObject", the "class2" instance is placed there, too.

 > Anymore info (or pointers to better docs) would be great. Thanks.
You can learn about "aq_parent" in the acquisition documentation.

Search "zope.org" for it (acquisition).


Dieter