Skip to content

Commit f34b6a2

Browse files
author
Richard Jones
committed
fixes to property editing through the web
1 parent 9179b25 commit f34b6a2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Fixed:
88
. #600700 ] doc/upgrading.txt: no info about 0.4.3
99
. #603696 ] Mail followup not inserted
1010
. #603703 ] way to unassign issues
11+
. some more fixes to property editing through the web
1112

1213

1314
2002-07-25 0.4.3

roundup/hyperdb.py

Lines changed: 11 additions & 6 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.69.2.2 2002-09-03 02:55:26 richard Exp $
18+
# $Id: hyperdb.py,v 1.69.2.3 2002-09-03 03:28:26 richard Exp $
1919

2020
__doc__ = """
2121
Hyperdatabase implementation, especially field types.
@@ -397,7 +397,7 @@ def create(self, **propvalues):
397397
raise KeyError, '"%s" has no property "%s"'%(self.classname,
398398
key)
399399

400-
if isinstance(prop, Link):
400+
if value is not None and isinstance(prop, Link):
401401
if type(value) != type(''):
402402
raise ValueError, 'link value must be String'
403403
link_class = self.properties[key].classname
@@ -589,16 +589,18 @@ class or a KeyError is raised.
589589
if isinstance(prop, Link):
590590
link_class = self.properties[key].classname
591591
# if it isn't a number, it's a key
592-
if type(value) != type(''):
593-
raise ValueError, 'link value must be String'
594-
if not num_re.match(value):
592+
if value is not None and not isinstance(value, type('')):
593+
raise ValueError, 'property "%s" link value be a string'%(
594+
key)
595+
if isinstance(value, type('')) and not num_re.match(value):
595596
try:
596597
value = self.db.classes[link_class].lookup(value)
597598
except (TypeError, KeyError):
598599
raise IndexError, 'new property "%s": %s not a %s'%(
599600
key, value, self.properties[key].classname)
600601

601-
if not self.db.hasnode(link_class, value):
602+
if (value is not None and
603+
not self.db.getclass(link_class).hasnode(value)):
602604
raise IndexError, '%s has no node %s'%(link_class, value)
603605

604606
if self.properties[key].do_journal:
@@ -1188,6 +1190,9 @@ def Choice(name, db, *options):
11881190

11891191
#
11901192
# $Log: not supported by cvs2svn $
1193+
# Revision 1.69.2.2 2002/09/03 02:55:26 richard
1194+
# bug in multilink meant changes might not be detected correctly
1195+
#
11911196
# Revision 1.69.2.1 2002/07/10 06:30:47 richard
11921197
# . #571170 ] gdbm deadlock
11931198
#

0 commit comments

Comments
 (0)