fixed issue 1361, typo in contains, thanks Villas

This commit is contained in:
mdipierro
2013-03-06 12:27:06 -06:00
parent 74ecc762f3
commit 778070dd8a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)