[Zope] Undo?

Chris Withers chrisw@nipltd.com
Thu, 09 Aug 2001 13:45:32 +0100


Phil Harris wrote:
> 
> If I though delete an object through calling
> manage_delObjects(ids=<somelist>) then the undo info is not saved.

I'm guessing you have a script that deletes several objects like this and and
onyl the script name is appearing in the undo log?

If so,

try changing it to be like this:

get_transaction().begin()        
manage_delObjects(ids=somelist)
get_transaction().note('Deleted %s' % string.join(somelist))
get_transaction().commit()        

Of course, if you want to be able to undo the deletion of each object, then
you'll want:

for id in somelist:
  get_transaction().begin()        
  manage_delObjects(ids=[id])
  get_transaction().note('Deleted %s' % id)
  get_transaction().commit()        

HTH,

Chris


> 
> Am I missing something, do I have to call something else, is this just not
> possible?
> 
> tia
> 
> Phil
> phil.harris@zope.co.uk
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )