From 8b12b6f0e716392183516aca8f60dac445a06de9 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 5 Apr 2016 16:57:54 +0200 Subject: [PATCH] add locations view --- Dockerfile | 2 +- app/festival/urls.py | 1 + app/festival/views.py | 12 +++++++++++- requirements-dev.txt | 1 - 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 094a278e..ab3dd4aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ ENV LANGUAGE fr_FR:fr ENV LC_ALL fr_FR.UTF-8 RUN mkdir /srv/app -RUN mkdir /srv/src +RUN mkdir /srv/lib WORKDIR /srv/app ADD requirements.txt /srv/app/ diff --git a/app/festival/urls.py b/app/festival/urls.py index 686b4770..61e51e07 100644 --- a/app/festival/urls.py +++ b/app/festival/urls.py @@ -14,4 +14,5 @@ urlpatterns = [ url(r'^artists/(?P.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"), url(r'^videos/$', VideoListView.as_view(), name="festival-video-list"), url(r'^videos/(?P.*)/$', VideoDetailView.as_view(), name="festival-video-detail"), + url(r'^locations/$', LocationListView.as_view(), name="festival-location-list"), ] diff --git a/app/festival/views.py b/app/festival/views.py index 7abd16b5..500fd961 100644 --- a/app/festival/views.py +++ b/app/festival/views.py @@ -4,6 +4,7 @@ from django.views.generic.base import * from django.shortcuts import get_object_or_404 from festival.models import * +from mezzanine_agenda.models import EventLocation class SlugMixin(object): @@ -53,4 +54,13 @@ class VideoDetailView(SlugMixin, DetailView): def get_context_data(self, **kwargs): context = super(VideoDetailView, self).get_context_data(**kwargs) return context - + + +class LocationListView(ListView): + + model = EventLocation + template_name='agenda/event_location_list.html' + + def get_context_data(self, **kwargs): + context = super(LocationListView, self).get_context_data(**kwargs) + return context diff --git a/requirements-dev.txt b/requirements-dev.txt index 1bd24089..4e0ea0eb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ -e git+https://github.com/yomguy/mezzanine-agenda.git#egg=mezzanine-agenda-0.2.2 -e git+https://github.com/stephenmcd/mezzanine.git#egg=mezzanine-4.1-dev https://forge.ircam.fr/p/django-eve/source/download/dev/ - -- 2.39.5