forgot to add SpeakerDetailView

This commit is contained in:
Thomas Steen Rasmussen 2016-08-08 19:45:32 +02:00
parent 4da3b61a89
commit be7afdebd4
3 changed files with 27 additions and 1 deletions

View file

@ -0,0 +1,21 @@
{% extends 'base.html' %}
{% load commonmark %}
{% block content %}
<h3>{{ speaker.name }}</h3>
{{ speaker.biography|commonmark }}
<hr />
{% if speaker.events.exists %}
{% for event in speaker.events.all %}
<h3>{{ event.title }}</h3>
{{ event.abstract|commonmark }}
{% endfor %}
{% endif %}
{% endblock %}

View file

@ -5,7 +5,7 @@ urlpatterns = [
url(r'^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})/$', views.ProgramDayView.as_view(), name='day'), url(r'^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})/$', views.ProgramDayView.as_view(), name='day'),
url(r'^$', views.ProgramOverviewView.as_view(), name='index'), url(r'^$', views.ProgramOverviewView.as_view(), name='index'),
url(r'^speakers/$', views.SpeakerListView.as_view(), name='speaker_index'), url(r'^speakers/$', views.SpeakerListView.as_view(), name='speaker_index'),
url(r'speakers/(?P<slug>[-_\w+]+)/$', views.SpeakerDetail.as_view(), name='speaker_detail'), url(r'speakers/(?P<slug>[-_\w+]+)/$', views.SpeakerDetailView.as_view(), name='speaker_detail'),
url(r'^events/$', views.EventListView.as_view(), name='events_index'), url(r'^events/$', views.EventListView.as_view(), name='events_index'),
url(r'^(?P<slug>[-_\w+]+)/$', views.EventDetailView.as_view(), name='event'), url(r'^(?P<slug>[-_\w+]+)/$', views.EventDetailView.as_view(), name='event'),
] ]

View file

@ -6,6 +6,11 @@ from django.views.generic import ListView, TemplateView, DetailView
from camps.models import Day from camps.models import Day
from . import models from . import models
class SpeakerDetailView(DetailView):
model = models.Speaker
template_name = 'speaker_detail.html'
class SpeakerListView(ListView): class SpeakerListView(ListView):
model = models.Speaker model = models.Speaker
template_name = 'speaker_list.html' template_name = 'speaker_list.html'