|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -#$Id: back_anydbm.py,v 1.91 2002-11-06 05:39:49 richard Exp $ |
| 18 | +#$Id: back_anydbm.py,v 1.92 2002-11-06 11:38:42 richard Exp $ |
19 | 19 | ''' |
20 | 20 | This module defines a backend that saves the hyperdatabase in a database |
21 | 21 | chosen by anydbm. It is guaranteed to always be available in python |
@@ -888,7 +888,7 @@ def create(self, **propvalues): |
888 | 888 | # done |
889 | 889 | self.db.addnode(self.classname, newid, propvalues) |
890 | 890 | if self.do_journal: |
891 | | - self.db.addjournal(self.classname, newid, 'create', propvalues) |
| 891 | + self.db.addjournal(self.classname, newid, 'create', {}) |
892 | 892 |
|
893 | 893 | self.fireReactors('create', newid, None) |
894 | 894 |
|
@@ -970,7 +970,7 @@ def import_list(self, propnames, proplist): |
970 | 970 | creation = None |
971 | 971 | if d.has_key('activity'): |
972 | 972 | del d['activity'] |
973 | | - self.db.addjournal(self.classname, newid, 'create', d, creator, |
| 973 | + self.db.addjournal(self.classname, newid, 'create', {}, creator, |
974 | 974 | creation) |
975 | 975 | return newid |
976 | 976 |
|
@@ -1145,9 +1145,11 @@ class or a KeyError is raised. |
1145 | 1145 |
|
1146 | 1146 | # if the value's the same as the existing value, no sense in |
1147 | 1147 | # doing anything |
1148 | | - if node.has_key(propname) and value == node[propname]: |
| 1148 | + current = node.get(propname, None) |
| 1149 | + if value == current: |
1149 | 1150 | del propvalues[propname] |
1150 | 1151 | continue |
| 1152 | + journalvalues[propname] = current |
1151 | 1153 |
|
1152 | 1154 | # do stuff based on the prop type |
1153 | 1155 | if isinstance(prop, Link): |
@@ -1283,8 +1285,7 @@ class or a KeyError is raised. |
1283 | 1285 | self.db.setnode(self.classname, nodeid, node) |
1284 | 1286 |
|
1285 | 1287 | if self.do_journal: |
1286 | | - propvalues.update(journalvalues) |
1287 | | - self.db.addjournal(self.classname, nodeid, 'set', propvalues) |
| 1288 | + self.db.addjournal(self.classname, nodeid, 'set', journalvalues) |
1288 | 1289 |
|
1289 | 1290 | self.fireReactors('set', nodeid, oldvalues) |
1290 | 1291 |
|
@@ -1612,7 +1613,6 @@ def filter(self, search_matches, filterspec, sort=(None,None), |
1612 | 1613 | # now, find all the nodes that are active and pass filtering |
1613 | 1614 | l = [] |
1614 | 1615 | cldb = self.db.getclassdb(cn) |
1615 | | - print filterspec |
1616 | 1616 | try: |
1617 | 1617 | # TODO: only full-scan once (use items()) |
1618 | 1618 | for nodeid in self.db.getnodeids(cn, cldb): |
|
0 commit comments