summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <ernesto.rico-schmidt@evolaris.net>2016-08-20 19:25:26 (GMT)
committerErnesto Rico-Schmidt <ernesto.rico-schmidt@evolaris.net>2016-08-20 19:29:55 (GMT)
commit4d830b21886e27e0a1b409cf5b40c78cd96c3d73 (patch)
tree2eb63363eb9508cf7615fd126086a9ace1ac5f48
parent4261cdac6e396294fe5f1b4fc3fcfdfaac6526c4 (diff)
list only active host and active shows.
-rw-r--r--program/views.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/program/views.py b/program/views.py
index 94164b6..7f9b1ce 100644
--- a/program/views.py
+++ b/program/views.py
@@ -15,24 +15,22 @@ from program.utils import tofirstdayinisoweek
class HostListView(ListView):
context_object_name = 'host_list'
- queryset = Host.objects.filter(is_always_visible=True).distinct()
+ queryset = Host.objects.filter(Q(is_always_visible=True) | Q(shows__programslots__until__gt=datetime.now())).distinct()
template_name = 'host_list.html'
class HostDetailView(DetailView):
context_object_name = 'host'
- queryset = Host.objects.filter(is_always_visible=True).distinct()
+ queryset = Host.objects.all()
template_name = 'host_detail.html'
class ShowListView(ListView):
context_object_name = 'show_list'
- queryset = Show.objects.exclude(id=1).distinct()
template_name = 'show_list.html'
def get_queryset(self):
queryset = Show.objects.filter(programslots__until__gt=date.today()).exclude(id=1).distinct()
-
if 'broadcastformat' in self.request.GET:
broadcastformat = get_object_or_404(BroadcastFormat, slug=self.request.GET['broadcastformat'])
queryset = queryset.filter(broadcastformat=broadcastformat)