How to delete an object given a path in Zope
- From: Dieter Maurer <dieter (at) handshake.de>
- Date: Wed, 15 Mar 2006 21:55:53 +0100
Takahashi, Michael wrote at 2006-3-14 12:25 -0800:
> ...
>Using restrictedTraverse I'm able to get the object by its path. I then
>want to delete this object.
When you have an object "obj" inside the site hierarchy, then
"obj.aq_inner.aq_parent" is its container (in this hierarcy).
Therefore, an idiom to delete "obj" is:
obj.aq_inner.aq_parent.manage_delObjects(obj.getId())
--
Dieter
_______________________________________________
Zope-Dev maillist - Zope-Dev (at) zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )