summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Ates <mates@entrouvert.com>2015-01-06 15:07:30 (GMT)
committerMikaël Ates <mates@entrouvert.com>2015-01-13 11:48:53 (GMT)
commitd3c20020b87adfe751477bf32b6dbe627d988ec2 (patch)
treea8c20b7487926458ea2930d7dff9e34698699767
parent9a7addab24538360209149743faca3a4c749d211 (diff)
downloadcalebasse-d3c20020b87adfe751477bf32b6dbe627d988ec2.zip
calebasse-d3c20020b87adfe751477bf32b6dbe627d988ec2.tar.gz
calebasse-d3c20020b87adfe751477bf32b6dbe627d988ec2.tar.bz2
Prefere reverse to permalink and use slug and not name to build a url.
-rw-r--r--calebasse/personnes/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/calebasse/personnes/models.py b/calebasse/personnes/models.py
index bb0d158..8a8de5c 100644
--- a/calebasse/personnes/models.py
+++ b/calebasse/personnes/models.py
@@ -7,6 +7,7 @@ from django.db.models import query
from django.contrib.auth.models import User
from django.template.defaultfilters import date as date_filter
from django import forms
+from django.core.urlresolvers import reverse
from model_utils.managers import InheritanceManager
@@ -104,10 +105,9 @@ class Worker(People):
return False
return True
- @models.permalink
def get_absolute_url(self):
- return ('worker_update', (), {
- 'service': self.services.all()[0].name.lower(),
+ return reverse('worker_update', kwargs={
+ 'service': self.services.all()[0].slug.lower(),
'pk': self.pk })
class Meta: