changeset 1019:a9a73d4e78b9 maint-0.4

fixes to property editing through the web
author Richard Jones <richard@users.sourceforge.net>
date Tue, 03 Sep 2002 03:28:26 +0000
parents cfc694864143
children 9513228a409a
files CHANGES.txt roundup/hyperdb.py
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Tue Sep 03 03:09:30 2002 +0000
+++ b/CHANGES.txt	Tue Sep 03 03:28:26 2002 +0000
@@ -8,6 +8,7 @@
  . #600700 ] doc/upgrading.txt: no info about 0.4.3
  . #603696 ] Mail followup not inserted
  . #603703 ] way to unassign issues
+ . some more fixes to property editing through the web
 
 
 2002-07-25 0.4.3
--- a/roundup/hyperdb.py	Tue Sep 03 03:09:30 2002 +0000
+++ b/roundup/hyperdb.py	Tue Sep 03 03:28:26 2002 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: hyperdb.py,v 1.69.2.2 2002-09-03 02:55:26 richard Exp $
+# $Id: hyperdb.py,v 1.69.2.3 2002-09-03 03:28:26 richard Exp $
 
 __doc__ = """
 Hyperdatabase implementation, especially field types.
@@ -397,7 +397,7 @@
                 raise KeyError, '"%s" has no property "%s"'%(self.classname,
                     key)
 
-            if isinstance(prop, Link):
+            if value is not None and isinstance(prop, Link):
                 if type(value) != type(''):
                     raise ValueError, 'link value must be String'
                 link_class = self.properties[key].classname
@@ -589,16 +589,18 @@
             if isinstance(prop, Link):
                 link_class = self.properties[key].classname
                 # if it isn't a number, it's a key
-                if type(value) != type(''):
-                    raise ValueError, 'link value must be String'
-                if not num_re.match(value):
+                if value is not None and not isinstance(value, type('')):
+                    raise ValueError, 'property "%s" link value be a string'%(
+                        key)
+                if isinstance(value, type('')) and not num_re.match(value):
                     try:
                         value = self.db.classes[link_class].lookup(value)
                     except (TypeError, KeyError):
                         raise IndexError, 'new property "%s": %s not a %s'%(
                             key, value, self.properties[key].classname)
 
-                if not self.db.hasnode(link_class, value):
+                if (value is not None and
+                        not self.db.getclass(link_class).hasnode(value)):
                     raise IndexError, '%s has no node %s'%(link_class, value)
 
                 if self.properties[key].do_journal:
@@ -1188,6 +1190,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.69.2.2  2002/09/03 02:55:26  richard
+# bug in multilink meant changes might not be detected correctly
+#
 # Revision 1.69.2.1  2002/07/10 06:30:47  richard
 #  . #571170 ] gdbm deadlock
 #

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