From a47940fc77fed830416cafab85dc960b918d5dd9 Mon Sep 17 00:00:00 2001 From: jpic <jamespic@gmail.com> Date: Sun, 27 Dec 2015 11:51:00 +0100 Subject: [PATCH] Added basic dossier detail and list urls --- representatives_votes/urls.py | 16 ++++++++++++++++ representatives_votes/views.py | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 representatives_votes/urls.py create mode 100644 representatives_votes/views.py diff --git a/representatives_votes/urls.py b/representatives_votes/urls.py new file mode 100644 index 0000000..fc32da7 --- /dev/null +++ b/representatives_votes/urls.py @@ -0,0 +1,16 @@ +from django.conf.urls import url + +import views + +urlpatterns = [ + url( + r'^dossier/(?P<pk>\d+)/$', + views.DossierDetail.as_view(), + name='dossier-detail' + ), + url( + r'dossier/$', + views.DossierList.as_view(), + name='dossier-list' + ), +] diff --git a/representatives_votes/views.py b/representatives_votes/views.py new file mode 100644 index 0000000..2c99bbe --- /dev/null +++ b/representatives_votes/views.py @@ -0,0 +1,11 @@ +from django.views import generic + +from .models import Dossier + + +class DossierList(generic.ListView): + model = Dossier + + +class DossierDetail(generic.DetailView): + model = Dossier -- GitLab