[Zope] Where does Object.createInObjectManager() find the object manager?
John Morton
jwm@plain.co.nz
Tue, 4 Apr 2000 14:30:21 +1200 (NZST)
Bruce Perens writes:
> Hi,
>
> I am creating a Z class object using:
>
> <dtml-with "Object.createInObjectManager(id, REQUEST)">
>
> I then try to create a sub-object _in_ that object with:
>
> <dtml-with "SubObject.createInObjectManager(id, REQUEST)">
>
> The outer object is derived from ObjectManager. But both objects are created
> in the same folder rather than one being created in the other. Please tell me
> the right magic words.
Anything that's inside the first <dtml-with...> should be operating in
the context of that newly creates object, so if the second
<dtml-with...> is place inside the first, that object should be created
inside the first one.
If the section object creation happens outside the first, you should,
in theory, be able to switch to the first object with <dtml-with
first_object_id>, but in practice, the new object doesn't seem to
exist until the dtml method has completed.
Naturally, I haven't tested the first suggestion, so I hope this helps
:-)
John.