Skip to content
Snippets Groups Projects
Commit 55a4c771 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

limited shows and host to active ones.

parent 03235487
Branches
Tags
No related merge requests found
from django.conf import settings from django.conf import settings
from django.conf.urls.defaults import * from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail, object_list from django.views.generic.list_detail import object_detail, object_list
from models import Host, Show, TimeSlot from models import Host, Show, TimeSlot
from views import current_show, day_schedule, recommendations, show_list, week_schedule from views import current_show, day_schedule, recommendations, show_list, week_schedule
from datetime import date
hosts_dict = { hosts_dict = {
'queryset': Host.objects.all(), 'queryset': Host.objects.filter(shows__programslots__until__gte=date.today()).distinct(),
'template_object_name': 'host' 'template_object_name': 'host'
} }
shows_dict = { shows_dict = {
'queryset': Show.objects.all(), 'queryset': Show.objects.filter(programslots__until__gt=date.today()).exclude(id=1).distinct(),
'template_object_name': 'show' 'template_object_name': 'show'
} }
timeslots_dict = { timeslots_dict = {
......
...@@ -6,7 +6,7 @@ from models import BroadcastFormat, MusicFocus, Note, Show, ShowInformation, Sho ...@@ -6,7 +6,7 @@ from models import BroadcastFormat, MusicFocus, Note, Show, ShowInformation, Sho
from datetime import date, datetime, time, timedelta from datetime import date, datetime, time, timedelta
def show_list(request): 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: if 'broadcastformat' in request.GET:
broadcastformat = get_object_or_404(BroadcastFormat, slug=request.GET['broadcastformat']) broadcastformat = get_object_or_404(BroadcastFormat, slug=request.GET['broadcastformat'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment