From 4cd4ff2c5ee97c996183bc93cce5e41fd6691d45 Mon Sep 17 00:00:00 2001 From: mpranjic Date: Thu, 19 Sep 2013 10:58:23 +0200 Subject: [PATCH] startswith, endswith and contains for upload fields --- gluon/dal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gluon/dal.py b/gluon/dal.py index 7258d3b9..4b3bb94d 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -9212,13 +9212,13 @@ class Expression(object): def startswith(self, value): db = self.db - if not self.type in ('string', 'text', 'json'): + if not self.type in ('string', 'text', 'json', 'upload'): raise SyntaxError("startswith used with incompatible field type") return Query(db, db._adapter.STARTSWITH, self, value) def endswith(self, value): db = self.db - if not self.type in ('string', 'text', 'json'): + if not self.type in ('string', 'text', 'json', 'upload'): raise SyntaxError("endswith used with incompatible field type") return Query(db, db._adapter.ENDSWITH, self, value) @@ -9236,7 +9236,7 @@ class Expression(object): return self.contains('') else: return reduce(all and AND or OR,subqueries) - if not self.type in ('string', 'text', 'json') and not self.type.startswith('list:'): + if not self.type in ('string', 'text', 'json', 'upload') and not self.type.startswith('list:'): raise SyntaxError("contains used with incompatible field type") return Query(db, db._adapter.CONTAINS, self, value, case_sensitive=case_sensitive)