diff polls/models.py @ 1035:eeaf387803c6

Remove usages of @models.permalink.
author Brian Neal <bgneal@gmail.com>
date Sat, 26 Dec 2015 21:33:55 -0600
parents ee87ea74d46b
children
line wrap: on
line diff
--- a/polls/models.py	Sat Dec 26 15:28:16 2015 -0600
+++ b/polls/models.py	Sat Dec 26 21:33:55 2015 -0600
@@ -5,6 +5,7 @@
 import datetime
 
 from django.contrib.auth.models import User
+from django.core.urlresolvers import reverse
 from django.db import models
 from django.db.models import Q
 
@@ -47,9 +48,8 @@
         ordering = ('-start_date', )
         get_latest_by = 'start_date'
 
-    @models.permalink
     def get_absolute_url(self):
-        return ('polls-detail', [], {'poll_id': str(self.id)})
+        return reverse('polls-detail', kwargs={'poll_id': str(self.pk)})
 
     def results(self):
         """