[Zope] Help w/ manage_delObjects
Cornel Nitu
c.nitu@finsiel.ro
Fri, 14 Feb 2003 18:40:50 +0200
Maybe because your object is not in the same folder with the python script....
So, you can try this:
>form action="delete"
> input type="submit" value="delete"
> input type=" hidden" value="<the relative url of the del_object>"
> name="del_object" # e.g. "parent_folder/object_to_be_deleted" ...
>/form
> request = container.REQUEST
> RESPONSE = request.RESPONSE
>
>
>context.manage_delObjects(context.restrictedTraverse(request.del_object).id())
> RESPONSE.redirect(request['HTTP_REFERER'])
It should work....
At 11:16 AM 2/14/2003 -0500, you wrote:
>I'm trying to delete an object but am encountering an error:
>My form is simple:
>
>form action="delete"
> input type="submit" value="delete"
> input type=" hidden" value="outputs id here" name="del_object"
>/form
>
>delete is a python script that looks like this:
> request = container.REQUEST
> RESPONSE = request.RESPONSE
>
> context.manage_delObjects(request.del_object)
> RESPONSE.redirect(request['HTTP_REFERER'])
>
>This is supposed to delete the object passed from the form being
>"del_object"
>
>My Error:
>Error Type: Bad Request
>Error Value: filetobedeleted_id.html does not exist
>
>However the file does exist - so I'm not for sure why this isn't deleting?
>
>
>_______________________________________________
>Zope maillist - Zope@zope.org
>http://mail.zope.org/mailman/listinfo/zope
>** No cross posts or HTML encoding! **
>(Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )