1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #5925 -- Added new lazily evaluated version of django.core.urlresolvers.reverse. Thanks, SmileyChris, Preston Timmons and Julien Phalip.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-04-29 11:49:59 +00:00
parent f459169170
commit 79afd55278
5 changed files with 56 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import iri_to_uri, force_unicode, smart_str
from django.utils.functional import memoize
from django.utils.functional import memoize, lazy
from django.utils.importlib import import_module
from django.utils.regex_helper import normalize
@@ -390,6 +390,8 @@ def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None, current
return iri_to_uri(u'%s%s' % (prefix, resolver.reverse(view,
*args, **kwargs)))
reverse_lazy = lazy(reverse, str)
def clear_url_caches():
global _resolver_cache
global _callable_cache