added schedule_presentation_detail

This commit is contained in:
Brian Rosner 2012-09-20 20:38:24 -06:00
parent 8dc8f5f34a
commit 1b3ef8d424
2 changed files with 13 additions and 0 deletions

View file

@ -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"),

View file

@ -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)