[damned-lies] Removed obsolete permalink decorator
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Removed obsolete permalink decorator
- Date: Thu, 15 Oct 2015 19:35:01 +0000 (UTC)
commit 02bb500ac3b95c9afac3ba6a45591e40b0d6077c
Author: Claude Paroz <claude 2xlibre net>
Date: Thu Oct 15 21:34:09 2015 +0200
Removed obsolete permalink decorator
people/models.py | 4 ++--
stats/models.py | 3 +--
teams/models.py | 7 +++----
vertimus/models.py | 8 ++++----
4 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/people/models.py b/people/models.py
index e102739..53676eb 100644
--- a/people/models.py
+++ b/people/models.py
@@ -21,6 +21,7 @@
import datetime
import re
from django.core.exceptions import ObjectDoesNotExist
+from django.core.urlresolvers import reverse
from django.db import models
from django.utils.html import escape
from django.utils.safestring import mark_safe
@@ -131,9 +132,8 @@ class Person(User):
def as_author(self):
return "%s <%s>" % (self.name, self.email)
- @models.permalink
def get_absolute_url(self):
- return ('person_detail_username', [self.username])
+ return reverse('person_detail_username', args=[self.username])
def coordinates_teams(self):
from teams.models import Team
diff --git a/stats/models.py b/stats/models.py
index f7e4110..6117165 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -101,9 +101,8 @@ class Module(models.Model):
def __cmp__(self, other):
return cmp(self.name, other.name)
- @models.permalink
def get_absolute_url(self):
- return ('stats.views.module', [self.name])
+ return reverse('module', args=[self.name])
def get_description(self):
return self.description and _(self.description) or self.name
diff --git a/teams/models.py b/teams/models.py
index d6f6051..0ff82e6 100644
--- a/teams/models.py
+++ b/teams/models.py
@@ -22,6 +22,7 @@ from datetime import datetime, timedelta
from django.db import models
from django.core import mail
+from django.core.urlresolvers import reverse
from django.utils import translation
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy, ugettext as _
@@ -104,9 +105,8 @@ class Team(models.Model):
def __unicode__(self):
return self.description
- @models.permalink
def get_absolute_url(self):
- return ('team_slug', [self.name])
+ return reverse('team_slug', args=[self.name])
def can_edit(self, user):
""" Return True if user is allowed to edit this team
@@ -219,9 +219,8 @@ class FakeTeam(object):
self.language = language
self.description = _("No team for locale %s") % self.language.locale
- @models.permalink
def get_absolute_url(self):
- return ('teams.views.team', [self.language.locale])
+ return reverse('team_slug', args=[self.language.locale])
def can_edit(self, user):
return False
diff --git a/vertimus/models.py b/vertimus/models.py
index c4f0262..a18299e 100644
--- a/vertimus/models.py
+++ b/vertimus/models.py
@@ -24,7 +24,8 @@ from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.sites.models import Site
-from django.core import mail, urlresolvers
+from django.core import mail
+from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Max
from django.db.models.signals import post_save, pre_delete
@@ -83,9 +84,8 @@ class State(models.Model):
return "%s: %s %s (%s - %s)" % (self.name, self.branch.module.name,
self.branch.name, self.language.name, self.domain.name)
- @models.permalink
def get_absolute_url(self):
- return ('vertimus_by_ids', [self.branch.id, self.domain.id, self.language.id])
+ return reverse('vertimus_by_ids', args=[self.branch.id, self.domain.id, self.language.id])
@property
def stats(self):
@@ -520,7 +520,7 @@ class Action(ActionAbstract):
return
current_site = Site.objects.get_current()
- url = "https://%s%s" % (current_site.domain, urlresolvers.reverse(
+ url = "https://%s%s" % (current_site.domain, reverse(
'vertimus_by_names',
args = (
state.branch.module.name,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]