fixed issue 989, thanks Dominic

This commit is contained in:
mdipierro
2012-09-10 07:51:45 -05:00
parent 1d825fda76
commit 359d6c9579
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.0.8 (2012-09-10 07:47:49) stable
Version 2.0.8 (2012-09-10 07:51:42) stable
+4 -1
View File
@@ -8197,7 +8197,10 @@ class Expression(object):
db = self.db
if isinstance(value,(list, tuple)):
subqueries = [self.contains(str(v).strip()) for v in value if str(v).strip()]
return reduce(all and AND or OR, subqueries,self.contains(''))
if not subqueries:
return self.contains('')
else:
return reduce(all and AND or OR,subqueries)
if not self.type in ('string', 'text') and not self.type.startswith('list:'):
raise SyntaxError, "contains used with incompatible field type"
return Query(db, db._adapter.CONTAINS, self, value)