diff roundup/backends/back_anydbm.py @ 1304:61ad556cfc8d

working toward 0.5.2 release
author Richard Jones <richard@users.sourceforge.net>
date Wed, 06 Nov 2002 11:38:43 +0000
parents 71be6588904f
children d034cb5929e6
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Wed Nov 06 05:39:50 2002 +0000
+++ b/roundup/backends/back_anydbm.py	Wed Nov 06 11:38:43 2002 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-#$Id: back_anydbm.py,v 1.91 2002-11-06 05:39:49 richard Exp $
+#$Id: back_anydbm.py,v 1.92 2002-11-06 11:38:42 richard Exp $
 '''
 This module defines a backend that saves the hyperdatabase in a database
 chosen by anydbm. It is guaranteed to always be available in python
@@ -888,7 +888,7 @@
         # done
         self.db.addnode(self.classname, newid, propvalues)
         if self.do_journal:
-            self.db.addjournal(self.classname, newid, 'create', propvalues)
+            self.db.addjournal(self.classname, newid, 'create', {})
 
         self.fireReactors('create', newid, None)
 
@@ -970,7 +970,7 @@
             creation = None
         if d.has_key('activity'):
             del d['activity']
-        self.db.addjournal(self.classname, newid, 'create', d, creator,
+        self.db.addjournal(self.classname, newid, 'create', {}, creator,
             creation)
         return newid
 
@@ -1145,9 +1145,11 @@
 
             # if the value's the same as the existing value, no sense in
             # doing anything
-            if node.has_key(propname) and value == node[propname]:
+            current = node.get(propname, None)
+            if value == current:
                 del propvalues[propname]
                 continue
+            journalvalues[propname] = current
 
             # do stuff based on the prop type
             if isinstance(prop, Link):
@@ -1283,8 +1285,7 @@
         self.db.setnode(self.classname, nodeid, node)
 
         if self.do_journal:
-            propvalues.update(journalvalues)
-            self.db.addjournal(self.classname, nodeid, 'set', propvalues)
+            self.db.addjournal(self.classname, nodeid, 'set', journalvalues)
 
         self.fireReactors('set', nodeid, oldvalues)
 
@@ -1612,7 +1613,6 @@
         # now, find all the nodes that are active and pass filtering
         l = []
         cldb = self.db.getclassdb(cn)
-        print filterspec
         try:
             # TODO: only full-scan once (use items())
             for nodeid in self.db.getnodeids(cn, cldb):

Roundup Issue Tracker: http://roundup-tracker.org/