[Zope] deleting objects in a folder from a script
Dieter Maurer
dieter@handshake.de
Wed, 9 Jan 2002 21:41:32 +0100
Tim Hicks writes:
> <snip>
>
> > I use this approach because I have already the function which does 2).
> > Now I browsed through the ObjectManager API, but I cannot find a way to
> > delete a certain child-object. How can I do that?
>
> Assuming 'parent_folder' is a variable holding the parent folder object of
> what you are trying to delete and 'id' is the id of what you want to delete,
> I think this is what you want...
>
> parent_folder.manage_delObjects(id)
Almost - note the plural:
"manage_delObjects" needs a sequence of ids. Therefore, you need to use
parent_folder.manage_delObjects([id])
Dieter