Hi all, I'm using a few methods of my own design to add objects to the ZODB. I then want to use the undo stuff in Zope to, well, undo ;). I'm using this code (kndly suggested by Chris Withers): t=get_transaction() t.begin() self.manage_addFolder(id=objID,title=objTitle) t.note('Added Folder %s' % objID) t.commit() OK so far, it indeed adds the folder and adds a note to the undo list. Now my problem is that the note is added at the root level and never shows up in the local undo list of the parent folder of the new folder (if that makes any sense at all). My question is, how would I get it to show in the 'local' undo list of the parent folder. Any suggestions? tia Phil phil.harris@zope.co.uk
Try (untested): t=get_transaction() t.begin() self.manage_addFolder(id=objID,title=objTitle) ob = getattr(self, id) t.note(string.join(ob.getPhysicalPath(), '/')) t.commit() The look in the undo list.... HTH, - C Chris Withers wrote:
Phil Harris wrote:
My question is, how would I get it to show in the 'local' undo list of the parent folder.
Yeah, that would be cool :-)
I guess this is just a pathetic "me too!" mail, though...
Chris
_______________________________________________ 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 )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com """ Killing hundreds of birds with thousands of stones """
participants (3)
-
Chris McDonough -
Chris Withers -
Phil Harris