From 1b3ef8d4247ddf92f9ebe56dc61a506fdc8e479f Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Thu, 20 Sep 2012 20:38:24 -0600 Subject: [PATCH] added schedule_presentation_detail --- symposion/schedule/urls.py | 1 + symposion/schedule/views.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/symposion/schedule/urls.py b/symposion/schedule/urls.py index 473439ec..8473d556 100644 --- a/symposion/schedule/urls.py +++ b/symposion/schedule/urls.py @@ -5,6 +5,7 @@ urlpatterns = patterns("symposion.schedule.views", url(r"^$", "schedule_detail", name="schedule_detail_slugless"), url(r"^edit/$", "schedule_edit", name="schedule_edit_slugless"), url(r"^list/$", "schedule_list", name="schedule_list_slugless"), + url(r"^presentation/(\d+)/$", "schedule_presentation_detail", name="schedule_presentation_detail"), url(r"^(\w+)/$", "schedule_detail", name="schedule_detail"), url(r"^(\w+)/edit/$", "schedule_edit", name="schedule_edit"), url(r"^(\w+)/list/$", "schedule_list", name="schedule_list"), diff --git a/symposion/schedule/views.py b/symposion/schedule/views.py index 8fcec405..bb70ce0b 100644 --- a/symposion/schedule/views.py +++ b/symposion/schedule/views.py @@ -13,6 +13,8 @@ def fetch_schedule(slug): qs = Schedule.objects.all() if slug is None: + if qs.count() > 1: + raise Http404() schedule = next(iter(qs), None) if schedule is None: raise Http404() @@ -96,3 +98,13 @@ def schedule_slot_edit(request, slug, slot_pk): "slot": slot, } return render(request, "schedule/_slot_edit.html", ctx) + + +def schedule_presentation_detail(request, pk): + + presentation = get_object_or_404(Presentation, pk=pk) + + ctx = { + "presentation": presentation, + } + return render(request, "schedule/presentation_detail.html", ctx)