Mercurial > p > roundup > code
changeset 2892:2eae5848912d
always honor indexme property on Strings (patch [SF#063711])
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 10 Nov 2004 22:22:59 +0000 |
| parents | bc72b1c7319b |
| children | 67bf41bf8165 |
| files | CHANGES.txt roundup/backends/back_anydbm.py roundup/backends/rdbms_common.py test/test_mysql.py |
| diffstat | 4 files changed, 23 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Wed Nov 10 08:58:47 2004 +0000 +++ b/CHANGES.txt Wed Nov 10 22:22:59 2004 +0000 @@ -34,6 +34,8 @@ Use this to specify server configuration file for the service. - added experimental multi-thread server - don't try to import all backends in backends.__init__ unless we *want* to +- TAL expressions like 'request/show/whatever' return True + if the request does not contain explicit @columns list Fixed: - postgres backend open doesn't hide corruption in schema (sf bug 956375) @@ -53,11 +55,10 @@ - enforce View Permission when serving file content (sf bug 1050470) - don't index common words (sf bug 1046612) - don't wrap query.item.html in a <span> (thanks Roch'e Compaan) -- TAL expressions like 'request/show/whatever' return True - if the request does not contain explicit @columns list - NumberHTMLProperty should return '' not "None" if not set (thanks William) - ensure multilink ordering in RDBMS backends (thanks Marcus Priesch) +- always honor indexme property on Strings (sf patch 1063711) 2004-10-15 0.7.8
--- a/roundup/backends/back_anydbm.py Wed Nov 10 08:58:47 2004 +0000 +++ b/roundup/backends/back_anydbm.py Wed Nov 10 22:22:59 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.173 2004-10-08 05:37:44 richard Exp $ +#$Id: back_anydbm.py,v 1.174 2004-11-10 22:22:58 richard Exp $ '''This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several @@ -884,7 +884,9 @@ elif isinstance(prop, String): if type(value) != type('') and type(value) != type(u''): raise TypeError, 'new property "%s" not a string'%key - self.db.indexer.add_text((self.classname, newid, key), value) + if prop.indexme: + self.db.indexer.add_text((self.classname, newid, key), + value) elif isinstance(prop, Password): if not isinstance(value, password.Password): @@ -1205,8 +1207,9 @@ elif isinstance(prop, String): if value is not None and type(value) != type('') and type(value) != type(u''): raise TypeError, 'new property "%s" not a string'%propname - self.db.indexer.add_text((self.classname, nodeid, propname), - value) + if prop.indexme: + self.db.indexer.add_text((self.classname, nodeid, propname), + value) elif isinstance(prop, Password): if not isinstance(value, password.Password):
--- a/roundup/backends/rdbms_common.py Wed Nov 10 08:58:47 2004 +0000 +++ b/roundup/backends/rdbms_common.py Wed Nov 10 22:22:59 2004 +0000 @@ -1,4 +1,4 @@ -# $Id: rdbms_common.py,v 1.139 2004-11-09 04:07:54 richard Exp $ +# $Id: rdbms_common.py,v 1.140 2004-11-10 22:22:58 richard Exp $ ''' Relational database (SQL) backend common code. Basics: @@ -1379,7 +1379,9 @@ elif isinstance(prop, String): if type(value) != type('') and type(value) != type(u''): raise TypeError, 'new property "%s" not a string'%key - self.db.indexer.add_text((self.classname, newid, key), value) + if prop.indexme: + self.db.indexer.add_text((self.classname, newid, key), + value) elif isinstance(prop, Password): if not isinstance(value, password.Password): @@ -1656,8 +1658,9 @@ elif isinstance(prop, String): if value is not None and type(value) != type('') and type(value) != type(u''): raise TypeError, 'new property "%s" not a string'%propname - self.db.indexer.add_text((self.classname, nodeid, propname), - value) + if prop.indexme: + self.db.indexer.add_text((self.classname, nodeid, propname), + value) elif isinstance(prop, Password): if not isinstance(value, password.Password): @@ -2428,13 +2431,14 @@ pwd.unpack(value) value = pwd d[propname] = value - if isinstance(prop, String) and prop.indexme: + if isinstance(prop, String): if type(value) != type('') and type(value) != type(u''): raise TypeError, \ 'new property "%(propname)s" not a string: %(value)r' \ % locals() - self.db.indexer.add_text((self.classname, newid, propname), - value) + if prop.indexme: + self.db.indexer.add_text((self.classname, newid, propname), + value) # get a new id if necessary if newid is None:
--- a/test/test_mysql.py Wed Nov 10 08:58:47 2004 +0000 +++ b/test/test_mysql.py Wed Nov 10 22:22:59 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_mysql.py,v 1.14 2004-11-03 01:34:21 richard Exp $ +# $Id: test_mysql.py,v 1.15 2004-11-10 22:22:59 richard Exp $ import unittest, os, shutil, time, imp @@ -27,7 +27,7 @@ class mysqlOpener: if have_backend('mysql'): - module = get_backends('mysql') + module = get_backend('mysql') def setUp(self): self.module.db_nuke(config)
