comparison bio/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 0b6bf9c5a982
children
comparison
equal deleted inserted replaced
1034:2f36abf65a62 1035:eeaf387803c6
7 7
8 from django.db import models 8 from django.db import models
9 from django.contrib.auth.models import User 9 from django.contrib.auth.models import User
10 from django.conf import settings 10 from django.conf import settings
11 from django.core.cache import cache 11 from django.core.cache import cache
12 from django.core.urlresolvers import reverse
12 from django.template.loader import render_to_string 13 from django.template.loader import render_to_string
13 14
14 from core.markup import SiteMarkup 15 from core.markup import SiteMarkup
15 import bio.flags 16 import bio.flags
16 from bio.signals import notify_profile_content_update 17 from bio.signals import notify_profile_content_update
135 super(UserProfile, self).save(*args, **kwargs) 136 super(UserProfile, self).save(*args, **kwargs)
136 137
137 if content_update: 138 if content_update:
138 notify_profile_content_update(self) 139 notify_profile_content_update(self)
139 140
140 @models.permalink
141 def get_absolute_url(self): 141 def get_absolute_url(self):
142 return ('bio-view_profile', (), {'username': self.user.username}) 142 return reverse('bio-view_profile', kwargs={'username': self.user.username})
143 143
144 def badge_ownership(self): 144 def badge_ownership(self):
145 return BadgeOwnership.objects.filter(profile=self).select_related('badge') 145 return BadgeOwnership.objects.filter(profile=self).select_related('badge')
146 146
147 def is_stranger(self): 147 def is_stranger(self):