Commit e6d4e44e authored by Jamesie Pic's avatar Jamesie Pic

Added Group.get_absolute_url

parent 0a6b37c3
......@@ -4,6 +4,7 @@ import hashlib
from datetime import datetime
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_str, smart_unicode
from django.utils.functional import cached_property
......@@ -115,7 +116,8 @@ class Representative(HashableModel, TimeStampedModel):
ordering = ['last_name', 'first_name']
def get_absolute_url(self):
return reverse('representatives:representative-detail', args=(self.slug,))
return reverse('representatives:representative-detail',
# Contact related models
......@@ -177,6 +179,10 @@ class Group(HashableModel, TimeStampedModel):
class Meta:
ordering = ('name',)
def get_absolute_url(self):
return reverse('representatives:representative-list',
class Constituency(HashableModel, TimeStampedModel):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment