[Zope] access to old revisions of objects, even deleted ones

Sam Brauer sam at webslingerz.com
Wed Oct 22 09:20:39 EDT 2003


I have a need to access all revisions of objects of a certain type in my 
ZODB.  It is straightforward enough to find all currently existing 
instances and then access each one's history.  The problem with that 
approach is that it misses objects that have been deleted (but could 
still be brought back by an undo operation).

Does anyone know a solution?

I saw a thread in the ZODB-dev archive 
(http://aspn.activestate.com/ASPN/Mail/Message/zodb-dev/1414727)
where Greg Ward of the MEMS Exchange offers a script that attempts to 
access all OIDs from zero up to DB.objectCount(), but for my ZODB it ran 
forever (apprently objectCount() returned a number greater than the 
actual number of objects in the storage).
Later in that thread, Jeremy Hylton suggests that one can use the _index 
attribute of a FileStorage to obtain a list of existing OIDs, but other 
storages don't necessarily have _index, and I'd prefer to write 
something that will work with any undoable storage.

Many thanks in advance,
Sam Brauer

ps. Maybe this message would be better posted on the ZODB list... I just 
thought I'd try the general list first.





More information about the Zope mailing list