Unverified Commit fb7281d0 by CapsLock

[fix] search

Signed-off-by: CapsLock <faimaison@legeox.net>
parent d6a6ff6b
......@@ -89,13 +89,22 @@ def default(db):
else:
squery = request.params['q']
db.execute("select distinct on (name) *"
" from domain_names dn where name like %s"
" and name is not null and name <> '' ",
db.execute(" with dns as (select * from domain_names dn)"
" select * from (select distinct on (id) * "
" from (select * from dns,"
" (select pic.id picture_id,"
" pic.description,"
" pic.filename picture_filename,"
" pdn.domain_name_id domain_id from pictures pic,"
" pictures_domain_names pdn"
" where pdn.picture_id = pic.id) pp"
" where dns.id = pp.domain_id"
" and name is not null and name like %s"
" order by random()) ppp) dd order by random()",
(('%%%s%%' % squery),))
else:
db.execute(" with dns as (select * from domain_names dn)"
" select * from (select distinct on (id) * """
" select * from (select distinct on (id) * "
" from (select * from dns,"
" (select pic.id picture_id,"
" pic.description,"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment