Skip to content

Commit 3fcbc8d

Browse files
author
Richard Jones
committed
Fix for old databases that contain properties that don't exist any more.
1 parent 439eb02 commit 3fcbc8d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

roundup/hyperdb.py

Lines changed: 12 additions & 1 deletion
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.60 2002-04-03 05:54:31 richard Exp $
18+
# $Id: hyperdb.py,v 1.61 2002-04-03 06:11:51 richard Exp $
1919

2020
__doc__ = """
2121
Hyperdatabase implementation, especially field types.
@@ -203,6 +203,9 @@ def unserialise(self, classname, node):
203203
properties = self.getclass(classname).getprops()
204204
d = {}
205205
for k, v in node.items():
206+
# avoid properties that don't exist any more
207+
if not properties.has_key(k):
208+
continue
206209
prop = properties[k]
207210
if isinstance(prop, Date) and v is not None:
208211
d[k] = date.Date(v)
@@ -1112,6 +1115,14 @@ def Choice(name, db, *options):
11121115

11131116
#
11141117
# $Log: not supported by cvs2svn $
1118+
# Revision 1.60 2002/04/03 05:54:31 richard
1119+
# Fixed serialisation problem by moving the serialisation step out of the
1120+
# hyperdb.Class (get, set) into the hyperdb.Database.
1121+
#
1122+
# Also fixed htmltemplate after the showid changes I made yesterday.
1123+
#
1124+
# Unit tests for all of the above written.
1125+
#
11151126
# Revision 1.59 2002/03/12 22:52:26 richard
11161127
# more pychecker warnings removed
11171128
#

0 commit comments

Comments
 (0)