Skip to content

Commit 39ab5c0

Browse files
author
Richard Jones
committed
always honor indexme property on Strings (patch [SF#063711])
1 parent b947f92 commit 39ab5c0

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

CHANGES.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Feature:
3434
Use this to specify server configuration file for the service.
3535
- added experimental multi-thread server
3636
- don't try to import all backends in backends.__init__ unless we *want* to
37+
- TAL expressions like 'request/show/whatever' return True
38+
if the request does not contain explicit @columns list
3739

3840
Fixed:
3941
- postgres backend open doesn't hide corruption in schema (sf bug 956375)
@@ -53,11 +55,10 @@ Fixed:
5355
- enforce View Permission when serving file content (sf bug 1050470)
5456
- don't index common words (sf bug 1046612)
5557
- don't wrap query.item.html in a <span> (thanks Roch'e Compaan)
56-
- TAL expressions like 'request/show/whatever' return True
57-
if the request does not contain explicit @columns list
5858
- NumberHTMLProperty should return '' not "None" if not set (thanks
5959
William)
6060
- ensure multilink ordering in RDBMS backends (thanks Marcus Priesch)
61+
- always honor indexme property on Strings (sf patch 1063711)
6162

6263

6364
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.173 2004-10-08 05:37:44 richard Exp $
18+
#$Id: back_anydbm.py,v 1.174 2004-11-10 22:22:58 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
@@ -884,7 +884,9 @@ def create_inner(self, **propvalues):
884884
elif isinstance(prop, String):
885885
if type(value) != type('') and type(value) != type(u''):
886886
raise TypeError, 'new property "%s" not a string'%key
887-
self.db.indexer.add_text((self.classname, newid, key), value)
887+
if prop.indexme:
888+
self.db.indexer.add_text((self.classname, newid, key),
889+
value)
888890

889891
elif isinstance(prop, Password):
890892
if not isinstance(value, password.Password):
@@ -1205,8 +1207,9 @@ def set_inner(self, nodeid, **propvalues):
12051207
elif isinstance(prop, String):
12061208
if value is not None and type(value) != type('') and type(value) != type(u''):
12071209
raise TypeError, 'new property "%s" not a string'%propname
1208-
self.db.indexer.add_text((self.classname, nodeid, propname),
1209-
value)
1210+
if prop.indexme:
1211+
self.db.indexer.add_text((self.classname, nodeid, propname),
1212+
value)
12101213

12111214
elif isinstance(prop, Password):
12121215
if not isinstance(value, password.Password):

roundup/backends/rdbms_common.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.139 2004-11-09 04:07:54 richard Exp $
1+
# $Id: rdbms_common.py,v 1.140 2004-11-10 22:22:58 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1379,7 +1379,9 @@ def create_inner(self, **propvalues):
13791379
elif isinstance(prop, String):
13801380
if type(value) != type('') and type(value) != type(u''):
13811381
raise TypeError, 'new property "%s" not a string'%key
1382-
self.db.indexer.add_text((self.classname, newid, key), value)
1382+
if prop.indexme:
1383+
self.db.indexer.add_text((self.classname, newid, key),
1384+
value)
13831385

13841386
elif isinstance(prop, Password):
13851387
if not isinstance(value, password.Password):
@@ -1656,8 +1658,9 @@ def set_inner(self, nodeid, **propvalues):
16561658
elif isinstance(prop, String):
16571659
if value is not None and type(value) != type('') and type(value) != type(u''):
16581660
raise TypeError, 'new property "%s" not a string'%propname
1659-
self.db.indexer.add_text((self.classname, nodeid, propname),
1660-
value)
1661+
if prop.indexme:
1662+
self.db.indexer.add_text((self.classname, nodeid, propname),
1663+
value)
16611664

16621665
elif isinstance(prop, Password):
16631666
if not isinstance(value, password.Password):
@@ -2428,13 +2431,14 @@ def import_list(self, propnames, proplist):
24282431
pwd.unpack(value)
24292432
value = pwd
24302433
d[propname] = value
2431-
if isinstance(prop, String) and prop.indexme:
2434+
if isinstance(prop, String):
24322435
if type(value) != type('') and type(value) != type(u''):
24332436
raise TypeError, \
24342437
'new property "%(propname)s" not a string: %(value)r' \
24352438
% locals()
2436-
self.db.indexer.add_text((self.classname, newid, propname),
2437-
value)
2439+
if prop.indexme:
2440+
self.db.indexer.add_text((self.classname, newid, propname),
2441+
value)
24382442

24392443
# get a new id if necessary
24402444
if newid is None:

test/test_mysql.py

Lines changed: 2 additions & 2 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: test_mysql.py,v 1.14 2004-11-03 01:34:21 richard Exp $
18+
# $Id: test_mysql.py,v 1.15 2004-11-10 22:22:59 richard Exp $
1919

2020
import unittest, os, shutil, time, imp
2121

@@ -27,7 +27,7 @@
2727

2828
class mysqlOpener:
2929
if have_backend('mysql'):
30-
module = get_backends('mysql')
30+
module = get_backend('mysql')
3131

3232
def setUp(self):
3333
self.module.db_nuke(config)

0 commit comments

Comments
 (0)