[ZODB-Dev] db.undoLog() does not work as documented ..

steve steve at lonetwin.net
Sat Aug 21 05:39:10 EDT 2010


Hi,

I was reading up on the zodb docs, specifically about undoing tansactions[1] 
where it mentions that ...

"""
undoLog(start, end[, func])() method on the DB instance returns the log of past 
transactions, returning transactions between the times start and end, measured 
in seconds from the epoch.
"""

but for some reason this does seem to work for me with various 
combination/variations of providing the seconds since epoch parameter...

 >>> import time
 >>> import transaction
 >>> from ZODB import FileStorage, DB
 >>> storage = FileStorage.FileStorage('var/karl.db')
 >>> db = DB(storage)
 >>> db.undoLog(time.mktime((2010, 8, 20, 15, 12, 00, 00, 00, 00)), time.time())
[]

or even:

 >>> db.undoLog(1282242600.0, 1282380668.0)
[]

however, when provided with a random int, it seems to work fine, ie:

 >>> db.undoLog(0, sys.maxint)

...works (ie: gives me transaction log from earliest to latest).

So, am I doing something wrong or is the documentation wrong ?

cheers,
- steve

[1] http://www.zodb.org/documentation/guide/transactions.html#undoing-changes
-- 
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/


More information about the ZODB-Dev mailing list