[Zope] NEWBIE: manage_delObject, manage_delProperties?

Danny William Adair danny@adair.net
Tue, 30 Oct 2001 14:29:11 +1300


On Tuesday 29 October 2001 20:1, Michael wrote:
> I'm trying to figure out how to delete an object from Zope.  I use
> manage_editProperties to add and index, and manage_changeProperties
> to edit and reindex, that all works fine, but I'm not sure how to delete.
>
> I am using :
>
> <dtml-call "propertysheets.entry_info.manage_delProperties(REQUEST)"> and
> this just gives me an error message and I also tried:
>
> <dtml-call "propertysheets.entry_info.manage_delObject(REQUEST)"> but
> that errors out too.

You have to call delObject(s) on the parent, because this is the object 
manager you are telling "delete one(some) of your objects".

If you are calling it on a folder (object manager), and you want to delete 
the object "entry_info" that lies in this folder, use this:

<dtml-call "manage_delObjects['entry_info']">

If you are calling your method on the object to be deleted itself (usually 
not so elegant), your DTML should look something like this:

<dtml-call "aq_parent.manage_delObjects([id])">

Keep in mind that manage_delObjects expects a list as a parameter. This list 
holds the ids of the (contained) objects to be deleted, not the objects 
themselves.

hth,
Danny