diff ygroup/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/ygroup/models.py	Sat Dec 26 15:28:16 2015 -0600
+++ b/ygroup/models.py	Sat Dec 26 21:33:55 2015 -0600
@@ -2,6 +2,7 @@
 Models for the ygroup application, which is a read-only archive of messages
 from the old Yahoo Group.
 """
+from django.core.urlresolvers import reverse
 from django.db import models
 
 
@@ -20,9 +21,8 @@
     def __unicode__(self):
         return u'Thread %d, %s' % (self.pk, self.title)
 
-    @models.permalink
     def get_absolute_url(self):
-        return ('ygroup-thread_view', [self.id])
+        return reverse('ygroup-thread_view', args=[self.pk])
 
 
 class Post(models.Model):
@@ -44,9 +44,8 @@
     def __unicode__(self):
         return u'Post %d, %s' % (self.pk, self.title)
 
-    @models.permalink
     def get_absolute_url(self):
-        return ('ygroup-post_view', [], {'pk': self.id})
+        return reverse('ygroup-post_view', kwargs={'pk': str(self.pk)})
 
     def search_title(self):
         return self.title