added schedule_presentation_detail
This commit is contained in:
parent
8dc8f5f34a
commit
1b3ef8d424
2 changed files with 13 additions and 0 deletions
|
@ -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"),
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue