diff options
| author | Marten Kenbeek <marten.knbk@gmail.com> | 2015-12-30 16:51:16 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-12-31 14:21:29 -0500 |
| commit | 16411b8400ad08f90c236bb2e18f65c655f903f8 (patch) | |
| tree | df01123093c126222e8f492512472e5834966100 /django/shortcuts.py | |
| parent | df3d5b1d73699b323aac377dffab039dca26c1e4 (diff) | |
Fixed #26013 -- Moved django.core.urlresolvers to django.urls.
Thanks to Tim Graham for the review.
Diffstat (limited to 'django/shortcuts.py')
| -rw-r--r-- | django/shortcuts.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/django/shortcuts.py b/django/shortcuts.py index b5f20b832c..bd6362e8de 100644 --- a/django/shortcuts.py +++ b/django/shortcuts.py @@ -3,7 +3,6 @@ This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ -from django.core import urlresolvers from django.db.models.base import ModelBase from django.db.models.manager import Manager from django.db.models.query import QuerySet @@ -11,6 +10,7 @@ from django.http import ( Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect, ) from django.template import loader +from django.urls import NoReverseMatch, reverse from django.utils import six from django.utils.encoding import force_text from django.utils.functional import Promise @@ -43,8 +43,8 @@ def redirect(to, *args, **kwargs): * A model: the model's `get_absolute_url()` function will be called. - * A view name, possibly with arguments: `urlresolvers.reverse()` will - be used to reverse-resolve the name. + * A view name, possibly with arguments: `urls.reverse()` will be used + to reverse-resolve the name. * A URL, which will be used as-is for the redirect location. @@ -123,8 +123,8 @@ def resolve_url(to, *args, **kwargs): * A model: the model's `get_absolute_url()` function will be called. - * A view name, possibly with arguments: `urlresolvers.reverse()` will - be used to reverse-resolve the name. + * A view name, possibly with arguments: `urls.reverse()` will be used + to reverse-resolve the name. * A URL, which will be returned as-is. """ @@ -144,8 +144,8 @@ def resolve_url(to, *args, **kwargs): # Next try a reverse URL resolution. try: - return urlresolvers.reverse(to, args=args, kwargs=kwargs) - except urlresolvers.NoReverseMatch: + return reverse(to, args=args, kwargs=kwargs) + except NoReverseMatch: # If this is a callable, re-raise. if callable(to): raise |
