From e798ad5e6e607573a536901aff62d51bbaeb8df6 Mon Sep 17 00:00:00 2001 From: jpic <jamespic@gmail.com> Date: Sun, 27 Dec 2015 20:19:40 +0100 Subject: [PATCH] Added Dossier.get_absolute_url --- representatives_votes/models.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/representatives_votes/models.py b/representatives_votes/models.py index 41514fd..f9609c6 100644 --- a/representatives_votes/models.py +++ b/representatives_votes/models.py @@ -1,21 +1,5 @@ # coding: utf-8 - -# This file is part of toutatis. -# -# toutatis is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of -# the License, or any later version. -# -# toutatis is distributed in the hope that it will -# be useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU General Affero Public -# License along with django-representatives. -# If not, see <http://www.gnu.org/licenses/>. - +from django.core.urlresolvers import reverse from django.db import models from representatives.models import (HashableModel, Representative, @@ -33,6 +17,9 @@ class Dossier(HashableModel, TimeStampedModel): def __unicode__(self): return unicode(self.title) + def get_absolute_url(self): + return reverse('representatives_votes:dossier-detail', args=(self.pk,)) + class Proposal(HashableModel, TimeStampedModel): dossier = models.ForeignKey(Dossier, related_name='proposals') -- GitLab