From d8ba67e2e35a5d5674b6cbd9d9cf751fe4dc8bc4 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 6 Sep 2012 08:41:23 -0500 Subject: [PATCH] fixed issue 977, contains empty list, thanks iiijjjjiii --- VERSION | 2 +- gluon/dal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2d283941..6e83a18f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.7 (2012-09-06 08:15:24) stable +Version 2.0.7 (2012-09-06 08:41:19) stable diff --git a/gluon/dal.py b/gluon/dal.py index 8a180561..8aaec0b6 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -8187,7 +8187,7 @@ 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) + return reduce(all and AND or OR, subqueries,self.contains('')) 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)