fixed issue 1361, typo in contains, thanks Villas
This commit is contained in:
@@ -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
@@ -2664,9 +2664,9 @@ class PostgreSQLAdapter(BaseAdapter):
|
|||||||
|
|
||||||
def CONTAINS(self,first,second,case_sensitive=False):
|
def CONTAINS(self,first,second,case_sensitive=False):
|
||||||
if first.type in ('string','text', 'json'):
|
if first.type in ('string','text', 'json'):
|
||||||
key = '%'+str(second).replace('%','%%')+'%'
|
second = '%'+str(second).replace('%','%%')+'%'
|
||||||
elif first.type.startswith('list:'):
|
elif first.type.startswith('list:'):
|
||||||
key = '%|'+str(second).replace('|','||').replace('%','%%')+'|%'
|
second = '%|'+str(second).replace('|','||').replace('%','%%')+'|%'
|
||||||
op = case_sensitive and self.LIKE or self.ILIKE
|
op = case_sensitive and self.LIKE or self.ILIKE
|
||||||
return op(first,key)
|
return op(first,key)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user