Mercurial > p > roundup > code
diff roundup/backends/rdbms_common.py @ 3082:29bd9f06160e
actor/activity update moved from Database.setnode() to Class.set_inner()
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Thu, 06 Jan 2005 17:35:34 +0000 |
| parents | b77961cdb9a0 |
| children | a8c2371f45b6 |
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py Wed Jan 05 22:35:31 2005 +0000 +++ b/roundup/backends/rdbms_common.py Thu Jan 06 17:35:34 2005 +0000 @@ -1,4 +1,4 @@ -# $Id: rdbms_common.py,v 1.144 2005-01-04 03:27:04 richard Exp $ +# $Id: rdbms_common.py,v 1.145 2005-01-06 17:35:34 a1s Exp $ ''' Relational database (SQL) backend common code. Basics: @@ -459,7 +459,7 @@ """ cols, mls = self.determine_columns(spec.properties.items()) - + # add on our special columns cols.append(('id', 'INTEGER PRIMARY KEY')) cols.append(('__retired__', 'INTEGER DEFAULT 0')) @@ -774,8 +774,8 @@ ''' Change the specified node. ''' if __debug__: - self.config.logging.getLogger('hyperdb').debug('setnode %s%s %r'%(classname, - nodeid, values)) + self.config.logging.getLogger('hyperdb').debug('setnode %s%s %r' + % (classname, nodeid, values)) # clear this node out of the cache if it's in there key = (classname, nodeid) @@ -783,11 +783,6 @@ del self.cache[key] self.cache_lru.remove(key) - # add the special props - values = values.copy() - values['activity'] = date.Date() - values['actor'] = self.getuid() - cl = self.classes[classname] props = cl.getprops() @@ -1536,6 +1531,9 @@ raise IndexError, 'Requested item is retired' num_re = re.compile('^\d+$') + # make a copy of the values dictionary - we'll modify the contents + propvalues = propvalues.copy() + # if the journal value is to be different, store it in here journalvalues = {} @@ -1702,6 +1700,10 @@ if not propvalues: return propvalues + # update the activity time + propvalues['activity'] = date.Date() + propvalues['actor'] = self.db.getuid() + # do the set, and journal it self.db.setnode(self.classname, nodeid, propvalues, multilink_changes)
