From: Guillaume Pellerin Date: Tue, 5 Apr 2016 14:57:54 +0000 (+0200) Subject: add locations view X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=8b12b6f0e716392183516aca8f60dac445a06de9;p=mezzo.git add locations view --- 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/ -