summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9bb0f2d)
raw | patch | inline | side by side (parent: 9bb0f2d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 14 Jan 2002 06:32:34 +0000 (06:32 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 14 Jan 2002 06:32:34 +0000 (06:32 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@539 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/hyperdb.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 7aa7094f55330e8eeb1c7fa2cc4158b4f10e1349..d232e9c33fa43ec010ae80924adf8f75547bc9ca 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
config attriubute on the db. This means that all config is obtained from
instance_config instead of the mish-mash of classes. This will make
switching to a ConfigParser setup easier too, I hope.
+ . #502951 ] adding new properties to old database
2002-01-08 - 0.4.0b1
diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py
index b4c06039c4259eac0e6a569cbb40a65879cd1d83..c221d0adf3346e722f1bcc01af63f971551fa56c 100644 (file)
--- a/roundup/hyperdb.py
+++ b/roundup/hyperdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: hyperdb.py,v 1.47 2002-01-14 02:20:15 richard Exp $
+# $Id: hyperdb.py,v 1.48 2002-01-14 06:32:34 richard Exp $
__doc__ = """
Hyperdatabase implementation, especially field types.
if isinstance(prop, Multilink):
propvalues[key] = []
else:
+ # TODO: None isn't right here, I think...
propvalues[key] = None
# convert all data to strings
if propname == 'id':
return nodeid
+ # get the property (raises KeyErorr if invalid)
+ prop = self.properties[propname]
+
# get the node's dict
d = self.db.getnode(self.classname, nodeid, cache=cache)
- if not d.has_key(propname) and default is not _marker:
- return default
- # get the value
- prop = self.properties[propname]
+ if not d.has_key(propname):
+ if default is _marker:
+ if isinstance(prop, Multilink):
+ return []
+ else:
+ # TODO: None isn't right here, I think...
+ return None
+ else:
+ return default
# possibly convert the marshalled data to instances
if isinstance(prop, Date):
value = l
propvalues[key] = value
- #handle removals
- l = node[key]
+ # handle removals
+ if node.has_key(key):
+ l = node[key]
+ else:
+ l = []
for id in l[:]:
if id in value:
continue
#
# $Log: not supported by cvs2svn $
+# Revision 1.47 2002/01/14 02:20:15 richard
+# . changed all config accesses so they access either the instance or the
+# config attriubute on the db. This means that all config is obtained from
+# instance_config instead of the mish-mash of classes. This will make
+# switching to a ConfigParser setup easier too, I hope.
+#
+# At a minimum, this makes migration a _little_ easier (a lot easier in the
+# 0.5.0 switch, I hope!)
+#
# Revision 1.46 2002/01/07 10:42:23 richard
# oops
#