Unverified Commit f73e59f6 by CapsLock

[Feature] Moar randomness (hosts list)

Signed-off-by: CapsLock <faimaison@legeox.net>
parent bac44a96
......@@ -94,17 +94,18 @@ def default(db):
" and name is not null and name <> '' ",
(('%%%s%%' % squery),))
else:
db.execute("with dns as (select * from domain_names dn)"
" select distinct on (id) * from (select * from dns,"
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 "
" where dns.id = pp.domain_id"
" and name is not null and name <> ''"
" order by random()) ppp;")
" order by random()) ppp) dd order by random()")
# db.execute("select * from domain_names dn"
# " where name is not null and name <> '' ")
domain_names = db.fetchall()
......
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