summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/urls.py7
-rw-r--r--program/views.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/program/urls.py b/program/urls.py
index 0f643d7..8ec547d 100644
--- a/program/urls.py
+++ b/program/urls.py
@@ -1,17 +1,18 @@
from django.conf import settings
from django.conf.urls.defaults import *
-
from django.views.generic.list_detail import object_detail, object_list
from models import Host, Show, TimeSlot
from views import current_show, day_schedule, recommendations, show_list, week_schedule
+from datetime import date
+
hosts_dict = {
- 'queryset': Host.objects.all(),
+ 'queryset': Host.objects.filter(shows__programslots__until__gte=date.today()).distinct(),
'template_object_name': 'host'
}
shows_dict = {
- 'queryset': Show.objects.all(),
+ 'queryset': Show.objects.filter(programslots__until__gt=date.today()).exclude(id=1).distinct(),
'template_object_name': 'show'
}
timeslots_dict = {
diff --git a/program/views.py b/program/views.py
index 554641e..2f5c137 100644
--- a/program/views.py
+++ b/program/views.py
@@ -6,7 +6,7 @@ from models import BroadcastFormat, MusicFocus, Note, Show, ShowInformation, Sho
from datetime import date, datetime, time, timedelta
def show_list(request):
- queryset = Show.objects.exclude(id=1)
+ queryset = Show.objects.filter(programslots__until__gt=date.today()).exclude(id=1).distinct()
if 'broadcastformat' in request.GET:
broadcastformat = get_object_or_404(BroadcastFormat, slug=request.GET['broadcastformat'])