Created
November 25, 2008 19:58
-
-
Save dirceu/29057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code can be used to delete an object that is return POSKeyErrors | |
# on a ZODB database. Run it using 'zopectl debug'. Tested with Zope 2.9. | |
container_id = '/path/to/container' | |
screwed_object_id = 'screwed_obj' | |
from ZODB.POSException import POSKeyError | |
import transaction | |
obj = app.unrestrictedTraverse(container_id) | |
obj._objects = tuple(filter(lambda i,n = id: i['id'] != n, obj._objects)) | |
delattr(obj, screwed_object_id) | |
transaction.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment