Skip to content

Commit e6ca1e6

Browse files
author
Richard Jones
committed
d'oh! killed retirement of nodes :( all better now...
1 parent e8b7b5b commit e6ca1e6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

roundup/hyperdb.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: hyperdb.py,v 1.61 2002-04-03 06:11:51 richard Exp $
18+
# $Id: hyperdb.py,v 1.62 2002-04-03 07:05:50 richard Exp $
1919

2020
__doc__ = """
2121
Hyperdatabase implementation, especially field types.
@@ -179,6 +179,13 @@ def serialise(self, classname, node):
179179
properties = self.getclass(classname).getprops()
180180
d = {}
181181
for k, v in node.items():
182+
# if the property doesn't exist, or is the "retired" flag then
183+
# it won't be in the properties dict
184+
if not properties.has_key(k):
185+
d[k] = v
186+
continue
187+
188+
# get the property spec
182189
prop = properties[k]
183190

184191
if isinstance(prop, Password):
@@ -203,10 +210,15 @@ def unserialise(self, classname, node):
203210
properties = self.getclass(classname).getprops()
204211
d = {}
205212
for k, v in node.items():
206-
# avoid properties that don't exist any more
213+
# if the property doesn't exist, or is the "retired" flag then
214+
# it won't be in the properties dict
207215
if not properties.has_key(k):
216+
d[k] = v
208217
continue
218+
219+
# get the property spec
209220
prop = properties[k]
221+
210222
if isinstance(prop, Date) and v is not None:
211223
d[k] = date.Date(v)
212224
elif isinstance(prop, Interval) and v is not None:
@@ -1115,6 +1127,9 @@ def Choice(name, db, *options):
11151127

11161128
#
11171129
# $Log: not supported by cvs2svn $
1130+
# Revision 1.61 2002/04/03 06:11:51 richard
1131+
# Fix for old databases that contain properties that don't exist any more.
1132+
#
11181133
# Revision 1.60 2002/04/03 05:54:31 richard
11191134
# Fixed serialisation problem by moving the serialisation step out of the
11201135
# hyperdb.Class (get, set) into the hyperdb.Database.

0 commit comments

Comments
 (0)