Tres Seaver wrote:
Takahashi, Michael wrote:


I've actually tried that.  The problem I run into is that the folder in
my path contains a dash. When I call manage_delObjects on the following:


obj = context.restrictedTraverse('webcasts/courses/2005-2006/temp')

You need to get a reference to the container, and call
'manage_delObject' on it, e.g.:

  container = context.restrictedTraverse('webcasts/courses/2005-2006')
  container.manage_delObject('temp')

I usually just call aq_parent

   obj = context.restrictedTraverse('webcasts/courses/2005-2006/temp')
   container = obj.aq_parent
   container.manage_delObject('temp')

If you are deleting a list of objects in different folders you need to do a bit of tapdancing not to delete parents first. Like reverse sorting on the length of the physical path.

--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

Phone:  +45 66 11 84 94
Mobile: +45 29 93 42 96

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@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 )

Reply via email to