Mercurial > public > sg101
diff contests/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 | 5ba2508939f7 |
children |
line wrap: on
line diff
--- a/contests/models.py Sat Dec 26 15:28:16 2015 -0600 +++ b/contests/models.py Sat Dec 26 21:33:55 2015 -0600 @@ -5,8 +5,9 @@ import random import datetime +from django.contrib.auth.models import User +from django.core.urlresolvers import reverse from django.db import models -from django.contrib.auth.models import User class PublicContestManager(models.Manager): @@ -51,9 +52,8 @@ def __unicode__(self): return self.title - @models.permalink def get_absolute_url(self): - return ('contests-contest', [], {'slug': self.slug}) + return reverse('contests-contest', kwargs={'slug': self.slug}) def save(self, *args, **kwargs): if not self.pk and not self.creation_date: