mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #22384 -- Removed the ability to reverse URLs by dotted path per deprecation timeline.
This commit is contained in:
parent
d79122f40b
commit
785cc71d5b
15 changed files with 93 additions and 298 deletions
|
@ -1051,13 +1051,6 @@ This will follow the normal :ref:`namespaced URL resolution strategy
|
|||
<topics-http-reversing-url-namespaces>`, including using any hints provided
|
||||
by the context as to the current application.
|
||||
|
||||
.. deprecated:: 1.8
|
||||
|
||||
You can also pass a dotted Python path to a view function, but this syntax
|
||||
is deprecated and will be removed in Django 1.10::
|
||||
|
||||
{% url 'path.to.some_view' v1 v2 %}
|
||||
|
||||
.. warning::
|
||||
|
||||
Don't forget to put quotes around the :func:`~django.conf.urls.url`
|
||||
|
|
|
@ -12,9 +12,8 @@ your code, Django provides the following function:
|
|||
|
||||
.. function:: reverse(viewname, urlconf=None, args=None, kwargs=None, current_app=None)
|
||||
|
||||
``viewname`` can be a string containing the Python path to the view object, a
|
||||
:ref:`URL pattern name <naming-url-patterns>`, or the callable view object.
|
||||
For example, given the following ``url``::
|
||||
``viewname`` can be a :ref:`URL pattern name <naming-url-patterns>` or the
|
||||
callable view object. For example, given the following ``url``::
|
||||
|
||||
from news import views
|
||||
|
||||
|
@ -63,24 +62,6 @@ namespaces into URLs on specific application instances, according to the
|
|||
The ``urlconf`` argument is the URLconf module containing the url patterns to
|
||||
use for reversing. By default, the root URLconf for the current thread is used.
|
||||
|
||||
.. deprecated:: 1.8
|
||||
|
||||
The ability to reverse using the Python path, e.g.
|
||||
``reverse('news.views.archive')``, has been deprecated.
|
||||
|
||||
.. admonition:: Make sure your views are all correct.
|
||||
|
||||
As part of working out which URL names map to which patterns, the
|
||||
``reverse()`` function has to import all of your URLconf files and examine
|
||||
the name of each view. This involves importing each view function. If
|
||||
there are *any* errors whilst importing any of your view functions, it
|
||||
will cause ``reverse()`` to raise an error, even if that view function is
|
||||
not the one you are trying to reverse.
|
||||
|
||||
Make sure that any views you reference in your URLconf files exist and can
|
||||
be imported correctly. Do not include lines that reference views you
|
||||
haven't written yet, because those views will not be importable.
|
||||
|
||||
.. note::
|
||||
|
||||
The string returned by ``reverse()`` is already
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue