Mercurial > p > roundup > code
diff roundup/backends/back_anydbm.py @ 4483:22bc0426e348
Second patch from issue2550688 -- with some changes:
- password.py now has a second class JournalPassword used for journal
storage. We have some backends that directly store serialized python
objects. Also when reading from the journal some backends expected the
string read to be usable as a parameter to a Password constructor.
This now calls a JournalPassword constructor in all these cases.
The new JournalPassword just keeps the scheme and has an empty
password.
- some factoring, move redundant implementation of "history" from
rdbms_common and back_anydbm to hyperdb.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Thu, 14 Apr 2011 15:42:41 +0000 |
| parents | 1613754d2646 |
| children | f8e85cf5f0fe |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Thu Apr 14 12:54:52 2011 +0000 +++ b/roundup/backends/back_anydbm.py Thu Apr 14 15:42:41 2011 +0000 @@ -1298,6 +1298,8 @@ raise TypeError('new property "%s" not a ' 'Password'%propname) propvalues[propname] = value + journalvalues[propname] = \ + current and password.JournalPassword(current) elif value is not None and isinstance(prop, hyperdb.Date): if not isinstance(value, date.Date): @@ -1423,23 +1425,6 @@ raise hyperdb.DatabaseError(_('Database open read-only')) self.db.destroynode(self.classname, nodeid) - def history(self, nodeid): - """Retrieve the journal of edits on a particular node. - - 'nodeid' must be the id of an existing node of this class or an - IndexError is raised. - - The returned list contains tuples of the form - - (nodeid, date, tag, action, params) - - 'date' is a Timestamp object specifying the time of the change and - 'tag' is the journaltag specified when the database was opened. - """ - if not self.do_journal: - raise ValueError('Journalling is disabled for this class') - return self.db.getjournal(self.classname, nodeid) - # Locating nodes: def hasnode(self, nodeid): """Determine if the given nodeid actually exists
