wiki uses contains instead of startswith, thanks David
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.0.9 (2012-10-01 21:16:35) dev
|
Version 2.0.9 (2012-10-02 14:50:06) dev
|
||||||
|
|||||||
+3
-1
@@ -3267,7 +3267,9 @@ class FireBirdAdapter(BaseAdapter):
|
|||||||
return 'SUBSTRING(%s from %s for %s)' % (self.expand(field), parameters[0], parameters[1])
|
return 'SUBSTRING(%s from %s for %s)' % (self.expand(field), parameters[0], parameters[1])
|
||||||
|
|
||||||
def CONTAINS(self, first, second):
|
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('%','%%')+'|'
|
key = '|'+str(second).replace('|','||').replace('%','%%')+'|'
|
||||||
return '(%s CONTAINING %s)' % (self.expand(first),
|
return '(%s CONTAINING %s)' % (self.expand(first),
|
||||||
self.expand(key,'string'))
|
self.expand(key,'string'))
|
||||||
|
|||||||
+1
-1
@@ -4921,7 +4921,7 @@ class Wiki(object):
|
|||||||
if query is None:
|
if query is None:
|
||||||
query = (db.wiki_page.id==db.wiki_tag.wiki_page)&\
|
query = (db.wiki_page.id==db.wiki_tag.wiki_page)&\
|
||||||
(db.wiki_tag.name.belongs(tags))
|
(db.wiki_tag.name.belongs(tags))
|
||||||
query = query|db.wiki_page.title.startswith(request.vars.q)
|
query = query|db.wiki_page.title.contains(request.vars.q)
|
||||||
if self.restrict_search and not self.manage():
|
if self.restrict_search and not self.manage():
|
||||||
query = query&(db.wiki_page.created_by==self.auth.user_id)
|
query = query&(db.wiki_page.created_by==self.auth.user_id)
|
||||||
pages = db(query).select(count,
|
pages = db(query).select(count,
|
||||||
|
|||||||
Reference in New Issue
Block a user