mirror of https://github.com/django/django.git
Added links from any reference to the url template tag to the appropriate place in the template tag documentation. Fixed #5198.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
79801f504f
commit
0a2337c9e3
|
@ -512,7 +512,7 @@ view::
|
||||||
|
|
||||||
This is completely valid, but it leads to problems when you try to do reverse
|
This is completely valid, but it leads to problems when you try to do reverse
|
||||||
URL matching (through the ``permalink()`` decorator or the ``{% url %}``
|
URL matching (through the ``permalink()`` decorator or the ``{% url %}``
|
||||||
template tag). Continuing this example, if you wanted to retrieve the URL for
|
`template tag`_). Continuing this example, if you wanted to retrieve the URL for
|
||||||
the ``archive`` view, Django's reverse URL matcher would get confused, because
|
the ``archive`` view, Django's reverse URL matcher would get confused, because
|
||||||
*two* URLpatterns point at that view.
|
*two* URLpatterns point at that view.
|
||||||
|
|
||||||
|
@ -552,14 +552,16 @@ not restricted to valid Python names.
|
||||||
name, will decrease the chances of collision. We recommend something like
|
name, will decrease the chances of collision. We recommend something like
|
||||||
``myapp-comment`` instead of ``comment``.
|
``myapp-comment`` instead of ``comment``.
|
||||||
|
|
||||||
|
.. _template tag: ../templates/#url
|
||||||
|
|
||||||
Utility methods
|
Utility methods
|
||||||
===============
|
===============
|
||||||
|
|
||||||
reverse()
|
reverse()
|
||||||
---------
|
---------
|
||||||
|
|
||||||
If you need to use something similar to the ``{% url %}`` template tag in your
|
If you need to use something similar to the ``{% url %}`` `template tag`_ in
|
||||||
code, Django provides the ``django.core.urlresolvers.reverse()``. The
|
your code, Django provides the ``django.core.urlresolvers.reverse()``. The
|
||||||
``reverse()`` function has the following signature::
|
``reverse()`` function has the following signature::
|
||||||
|
|
||||||
reverse(viewname, urlconf=None, args=None, kwargs=None)
|
reverse(viewname, urlconf=None, args=None, kwargs=None)
|
||||||
|
|
Loading…
Reference in New Issue