From aa6a4f84601395c56124146d55cbb7e5b0d5b0c1 Mon Sep 17 00:00:00 2001 From: Patrick Samson Date: Sat, 10 Aug 2013 21:12:19 +0200 Subject: [PATCH] Substitution of the permalink decorator, no more recommended --- docs/conf.py | 2 +- postman/__init__.py | 2 +- postman/models.py | 4 ++-- postman/tests.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 972e1b6..0894775 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ copyright = u'2010, Patrick Samson' # The short X.Y version. version = '3.0' # The full version, including alpha/beta/rc tags. -release = '3.0.1' +release = '3.0.1.post1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/postman/__init__.py b/postman/__init__.py index decc7d4..86783a7 100644 --- a/postman/__init__.py +++ b/postman/__init__.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals # following PEP 386: N.N[.N]+[{a|b|c|rc}N[.N]+][.postN][.devN] VERSION = (3, 0, 1) PREREL = () -POST = 0 +POST = 1 DEV = 0 # options diff --git a/postman/models.py b/postman/models.py index cbacb82..5162767 100644 --- a/postman/models.py +++ b/postman/models.py @@ -7,6 +7,7 @@ try: except ImportError: from postman.future_1_5 import get_user_model from django.core.exceptions import ValidationError +from django.core.urlresolvers import reverse from django.db import models from django.db.models.query import QuerySet try: @@ -258,9 +259,8 @@ class Message(models.Model): def __unicode__(self): return "{0}>{1}:{2}".format(self.obfuscated_sender, self.obfuscated_recipient, Truncator(self.subject).words(5)) - @models.permalink def get_absolute_url(self): - return ('postman_view', [str(self.pk)]) + return reverse('postman_view', args=[self.pk]) def is_pending(self): """Tell if the message is in the pending state.""" diff --git a/postman/tests.py b/postman/tests.py index d5fae8e..669d2d5 100644 --- a/postman/tests.py +++ b/postman/tests.py @@ -76,7 +76,7 @@ class GenericTest(TestCase): Usual generic tests. """ def test_version(self): - self.assertEqual(sys.modules['postman'].__version__, "3.0.1") + self.assertEqual(sys.modules['postman'].__version__, "3.0.1.post1") class BaseTest(TestCase): -- 2.39.5