From 778070dd8aedb34ca4fda24070df4c0e96066bf0 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 6 Mar 2013 12:27:06 -0600 Subject: [PATCH] fixed issue 1361, typo in contains, thanks Villas --- VERSION | 2 +- gluon/dal.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index a4a8ae96..b07178d3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.2-stable+timestamp.2013.03.06.12.23.52 +Version 2.4.2-stable+timestamp.2013.03.06.12.26.28 diff --git a/gluon/dal.py b/gluon/dal.py index 83d92743..2557d3fc 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -2664,9 +2664,9 @@ class PostgreSQLAdapter(BaseAdapter): def CONTAINS(self,first,second,case_sensitive=False): if first.type in ('string','text', 'json'): - key = '%'+str(second).replace('%','%%')+'%' + second = '%'+str(second).replace('%','%%')+'%' elif first.type.startswith('list:'): - key = '%|'+str(second).replace('|','||').replace('%','%%')+'|%' + second = '%|'+str(second).replace('|','||').replace('%','%%')+'|%' op = case_sensitive and self.LIKE or self.ILIKE return op(first,key)