Mercurial > p > roundup > code
diff roundup/backends/rdbms_common.py @ 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 | 23ed4195e442 |
| children | 2ddba486546a |
line wrap: on
line diff
--- 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:
