From 149eff999483b0b7e22d81b089c0da6b34024525 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 10 Mar 2021 22:09:33 +0100 Subject: add extra div for host-detail in V2 template and fix join without distinct in host model diff --git a/program/models.py b/program/models.py index 7951c35..b5123cb 100644 --- a/program/models.py +++ b/program/models.py @@ -240,7 +240,7 @@ class Host(models.Model): return reverse('host-detail', args=[str(self.id)]) def active_shows(self): - return self.shows.filter(programslots__until__gt=datetime.today) + return self.shows.filter(programslots__until__gt=datetime.today).distinct() class Show(models.Model): diff --git a/program/templates/v2/host_detail.html b/program/templates/v2/host_detail.html index 0dff882..f5cac4d 100644 --- a/program/templates/v2/host_detail.html +++ b/program/templates/v2/host_detail.html @@ -7,18 +7,20 @@

{{ host.name }}

-
-
Sendungen
+
+
+
Sendungen
{% for show in host.active_shows %} - + {% endfor %} -
+
{% if host.email %} -
E-Mail Adresse: {{ host.email }}
+
E-Mail Adresse: {{ host.email }}
{% endif %} {% if host.website %} - + {% endif %} +
-- cgit v0.10.2