Unverified Commit e94a918d by CapsLock

[feature] display pictures of direct alias

Signed-off-by: CapsLock <faimaison@legeox.net>
parent 9f4d6012
......@@ -99,11 +99,20 @@ def default(db):
" where name is not null and name <> '' ")
domain_names = db.fetchall()
else:
db.execute(
"select p.* from pictures p, pictures_domain_names pdn,"
" domain_names dn where p.id = pdn.picture_id"
" and pdn.domain_name_id = dn.id"
" and dn.name = %s", (get_host_name(),))
db.execute('with pics as('
' with pres as (select * from domain_names where name=%s'
' union all select * from domain_names where related_to in'
' (select id from domain_names where name=%s))'
' select p.* from pictures p, pictures_domain_names pdn,'
' pres where p.id = pdn.picture_id'
' and pdn.domain_name_id = pres.id'
' union all'
' select p.* from pictures p, pictures_domain_names pdn,'
' pres'
' where p.id = pdn.picture_id'
' and pdn.domain_name_id = pres.related_to)'
' select distinct on (id) * from pics;',
(get_host_name(), get_host_name()))
pictures = db.fetchall()
db.execute("select * from domain_names where id in("
......
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