wiki uses contains instead of startswith, thanks David

This commit is contained in:
Massimo
2012-10-02 14:50:16 -05:00
parent 563934dcac
commit b41490a6f6
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -3267,7 +3267,9 @@ class FireBirdAdapter(BaseAdapter):
return 'SUBSTRING(%s from %s for %s)' % (self.expand(field), parameters[0], parameters[1])
def CONTAINS(self, first, second):
if first.type.startswith('list:'):
if first.type in ('string','text'):
key = str(second).replace('%','%%')
elif first.type.startswith('list:'):
key = '|'+str(second).replace('|','||').replace('%','%%')+'|'
return '(%s CONTAINING %s)' % (self.expand(first),
self.expand(key,'string'))