[Zope-dev] RE: How to delete an object given a path in Zope

Takahashi, Michael MTakahashi at oid.ucla.edu
Wed Mar 15 11:33:28 EST 2006


Hi Suresh,

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')
id = obj.getId()
context.webcasts.courses.2005-2006.manage_delObjects(id)

Python complains about the '-' in 2005-2006 on the third line. So my
thought was that if you had the object reference you could somehow
delete that reference like so:


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


This however does not work. It gives the following error:

Error Type
    AttributeError
Error Value
    temp

Side note: I'm running Zope 2.7.6

Thanks,

Mike


-----Original Message-----
From: suresh [mailto:suresh_vv at yahoo.com] 
Sent: Wednesday, March 15, 2006 3:09 AM
To: Takahashi, Michael
Subject: Re: How to delete an object given a path in Zope

>> Takahashi, Michael wrote:
>>> 
>>> I am trying to figure out how to delete an object in Zope given a
path.
>>> 
>>>  
>> <snip>
>>   
>>> 
>>> Any help is greatly appreciated.
>>> 


You want to call manage_delObjects on the parent folder and give it the 
list of ids.




More information about the Zope-Dev mailing list