mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
unicode: Added call to iri_to_uri() on the result of a reverse() call. This
makes using the permalink() decorator more natural. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5327 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fbce6f6bdc
commit
31d5d55090
@ -9,6 +9,7 @@ a string) and returns a tuple in this format:
|
|||||||
|
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
|
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
|
||||||
|
from django.utils.encoding import iri_to_uri
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class Resolver404(Http404):
|
class Resolver404(Http404):
|
||||||
@ -248,4 +249,4 @@ def reverse(viewname, urlconf=None, args=None, kwargs=None):
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
urlconf = settings.ROOT_URLCONF
|
urlconf = settings.ROOT_URLCONF
|
||||||
resolver = RegexURLResolver(r'^/', urlconf)
|
resolver = RegexURLResolver(r'^/', urlconf)
|
||||||
return '/' + resolver.reverse(viewname, *args, **kwargs)
|
return iri_to_uri(u'/' + resolver.reverse(viewname, *args, **kwargs))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user