Skip to content

Commit 70c29a7

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 08e848d commit 70c29a7

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Fixed:
1919
- NumberHTMLProperty should return '' not "None" if not set (thanks
2020
William)
2121
- ensure multilink ordering in RDBMS backends (thanks Marcus Priesch)
22+
- always honor indexme property on Strings (sf patch 1063711)
2223

2324

2425
2004-10-15 0.7.8

roundup/backends/back_anydbm.py

Lines changed: 7 additions & 4 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: back_anydbm.py,v 1.146.2.18 2004-07-22 04:46:10 richard Exp $
18+
#$Id: back_anydbm.py,v 1.146.2.19 2004-11-10 22:26:07 richard Exp $
1919
'''This module defines a backend that saves the hyperdatabase in a
2020
database chosen by anydbm. It is guaranteed to always be available in python
2121
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -909,7 +909,9 @@ def create_inner(self, **propvalues):
909909
elif isinstance(prop, String):
910910
if type(value) != type('') and type(value) != type(u''):
911911
raise TypeError, 'new property "%s" not a string'%key
912-
self.db.indexer.add_text((self.classname, newid, key), value)
912+
if prop.indexme:
913+
self.db.indexer.add_text((self.classname, newid, key),
914+
value)
913915

914916
elif isinstance(prop, Password):
915917
if not isinstance(value, password.Password):
@@ -1230,8 +1232,9 @@ def set_inner(self, nodeid, **propvalues):
12301232
elif isinstance(prop, String):
12311233
if value is not None and type(value) != type('') and type(value) != type(u''):
12321234
raise TypeError, 'new property "%s" not a string'%propname
1233-
self.db.indexer.add_text((self.classname, nodeid, propname),
1234-
value)
1235+
if prop.indexme:
1236+
self.db.indexer.add_text((self.classname, nodeid, propname),
1237+
value)
12351238

12361239
elif isinstance(prop, Password):
12371240
if not isinstance(value, password.Password):

roundup/backends/rdbms_common.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.98.2.26 2004-11-09 04:10:28 richard Exp $
1+
# $Id: rdbms_common.py,v 1.98.2.27 2004-11-10 22:26:07 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1420,7 +1420,9 @@ def create_inner(self, **propvalues):
14201420
elif isinstance(prop, String):
14211421
if type(value) != type('') and type(value) != type(u''):
14221422
raise TypeError, 'new property "%s" not a string'%key
1423-
self.db.indexer.add_text((self.classname, newid, key), value)
1423+
if prop.indexme:
1424+
self.db.indexer.add_text((self.classname, newid, key),
1425+
value)
14241426

14251427
elif isinstance(prop, Password):
14261428
if not isinstance(value, password.Password):
@@ -1696,8 +1698,9 @@ def set_inner(self, nodeid, **propvalues):
16961698
elif isinstance(prop, String):
16971699
if value is not None and type(value) != type('') and type(value) != type(u''):
16981700
raise TypeError, 'new property "%s" not a string'%propname
1699-
self.db.indexer.add_text((self.classname, nodeid, propname),
1700-
value)
1701+
if prop.indexme:
1702+
self.db.indexer.add_text((self.classname, nodeid, propname),
1703+
value)
17011704

17021705
elif isinstance(prop, Password):
17031706
if not isinstance(value, password.Password):
@@ -2489,11 +2492,14 @@ def import_list(self, propnames, proplist):
24892492
pwd.unpack(value)
24902493
value = pwd
24912494
d[propname] = value
2492-
if isinstance(prop, String) and prop.indexme:
2495+
if isinstance(prop, String):
24932496
if type(value) != type('') and type(value) != type(u''):
2494-
raise TypeError, 'new property "%s" not a string'%key
2495-
self.db.indexer.add_text((self.classname, newid, propname),
2496-
value)
2497+
raise TypeError, \
2498+
'new property "%(propname)s" not a string: %(value)r' \
2499+
% locals()
2500+
if prop.indexme:
2501+
self.db.indexer.add_text((self.classname, newid, propname),
2502+
value)
24972503

24982504
# get a new id if necessary
24992505
if newid is None:

0 commit comments

Comments
 (0)