[Zope] Adding CatalogAware objects with the desired path
Kevin Dangoor
kid@kendermedia.com
Tue, 19 Oct 1999 18:03:30 -0400
Hi,
Let's say I have an arrangement like this:
Folder
Object1
Method
where Object1 is a ZClass that has CatalogAware as a base class. Let's say I
want to add a new Object2 via "Method". So, the URL would be
http://mysite/Folder/Object1/Method
If I do this, in Method:
<dtml-with Folder>
<dtml-with "manage_addProduct['MyProd']">
...stuff to initialize object...
<dtml-call "Object_add(_.None, _, NoRedir=1)">
</dtml-with>
</dtml-with>
The object is created just fine, but what gets added to the Catalog is:
/Folder/Object1/Folder/Object2
Understandably so... but is there a way to have the object added appear in
the Catalog as:
/Folder/Object2
??
I tried <dtml-call "Object_add(Folder, _, NoRedir=1)">, but this didn't
work. I have a feeling that it's actually the _ namespace that needs to
change, but I'm not sure what kind of change would do what is needed...
Any hints?
Thanks,
Kevin