fixed issue 977, contains empty list, thanks iiijjjjiii
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.0.7 (2012-09-06 08:15:24) stable
|
Version 2.0.7 (2012-09-06 08:41:19) stable
|
||||||
|
|||||||
+1
-1
@@ -8187,7 +8187,7 @@ class Expression(object):
|
|||||||
db = self.db
|
db = self.db
|
||||||
if isinstance(value,(list, tuple)):
|
if isinstance(value,(list, tuple)):
|
||||||
subqueries = [self.contains(str(v).strip()) for v in value if str(v).strip()]
|
subqueries = [self.contains(str(v).strip()) for v in value if str(v).strip()]
|
||||||
return reduce(all and AND or OR, subqueries)
|
return reduce(all and AND or OR, subqueries,self.contains(''))
|
||||||
if not self.type in ('string', 'text') and not self.type.startswith('list:'):
|
if not self.type in ('string', 'text') and not self.type.startswith('list:'):
|
||||||
raise SyntaxError, "contains used with incompatible field type"
|
raise SyntaxError, "contains used with incompatible field type"
|
||||||
return Query(db, db._adapter.CONTAINS, self, value)
|
return Query(db, db._adapter.CONTAINS, self, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user