{"id":3210,"date":"2018-02-23T07:30:00","date_gmt":"2018-02-23T06:30:00","guid":{"rendered":"http:\/\/blog.gocept.com\/?p=3210"},"modified":"2018-02-23T07:30:00","modified_gmt":"2018-02-23T06:30:00","slug":"zope-undo-transactions-via-debug-console","status":"publish","type":"post","link":"https:\/\/blog.gocept.com\/2018\/02\/23\/zope-undo-transactions-via-debug-console\/","title":{"rendered":"Zope \u2013 undo transactions via debug console"},"content":{"rendered":"

If you cannot access the root level in Zope 2 via the browser but you are able to use the debug console you have enough to undo transactions.<\/p>\n

Start the debug console:<\/p>\n

$ bin\/zinstance debug<\/pre>\n

List the transaction descriptions, user names and ids of the last 10 transactions:<\/p>\n

>>> from pprint import pprint\n>>> pprint(app._p_jar.db().undoInfo(0, 10))<\/pre>\n

(0 is the youngest transaction, the first one to show)<\/p>\n

Undo some transactions:<\/p>\n

>>> import transaction\n>>> transaction.get().note(u<\/span>\"<\/span>Undo transactions: ...\")\n<\/span>>>> app._p_jar.db().undoMultiple([id1<\/em>, id2<\/em>])\n>>> transaction.commit()<\/pre>\n

(id1, id2<\/em> have to be the actual id strings from the transaction listing.)<\/p>\n

Be aware:<\/p>\n