diff options
Diffstat (limited to 'program/urls.py')
-rw-r--r-- | program/urls.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/program/urls.py b/program/urls.py index 637ad97..bf798ec 100644 --- a/program/urls.py +++ b/program/urls.py @@ -1,20 +1,20 @@ from django.conf.urls.defaults import * -from django.views.generic.detail import DetailView -from django.views.generic.list import ListView + +from django.views.generic.list_detail import object_detail, object_list from models import Host, Show, TimeSlot -from views import CurrentShowView, DayScheduleView, RecommendationsView, ShowListView, TodayScheduleView, WeekScheduleView +from views import current_show, day_schedule, recommendations, show_list, today_schedule, week_schedule urlpatterns = patterns('', - ('^$', TodayScheduleView.as_view()), - ('^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', DayScheduleView.as_view()), - ('^(?P<year>\d{4})/(?P<week>\d{1,2})/$', WeekScheduleView.as_view()), - ('^current_box/$', CurrentShowView.as_view()), - ('^hosts/$', ListView.as_view(model=Host, context_object_name='hosts')), - url('^host/(?P<pk>\d+)/$', DetailView.as_view(model=Host), name='host-detail'), - ('^recommendations/$', RecommendationsView.as_view()), - ('^recommendations_box/$', RecommendationsView.as_view(template_name='program/recommendations_box.html')), - ('^shows/$', ShowListView.as_view()), - url('^show/(?P<slug>[\w-]+)/$', DetailView.as_view(model=Show), name='show-detail'), - url('^(?P<pk>\d+)/$', DetailView.as_view(model=TimeSlot), name='timeslot-detail'), -)
\ No newline at end of file + ('^$', today_schedule), + ('^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', day_schedule), + ('^(?P<year>\d{4})/(?P<week>\d{1,2})/$', week_schedule), + ('^current_box/$', current_show), + ('^hosts/$', object_list, dict(template_object_name='host', queryset=Host.objects.all())), + url('^host/(?P<object_id>\d+)/$', object_detail, dict(template_object_name='host', queryset=Host.objects.all()), name='host-detail'), + ('^recommendations/$', recommendations), + ('^recommendations_box/$', recommendations, dict(template_name='program/recommendations_box.html')), + ('^shows/$', show_list), + url('^show/(?P<slug>[\w-]+)/$', object_detail, dict(template_object_name='show', queryset=Show.objects.all()), name='show-detail'), + url('^(?P<object_id>\d+)/$', object_detail, dict(template_object_name='timeslot', queryset=TimeSlot.objects.all()), name='timeslot-detail'), +) |