Fixed #16653 - Added example of kwargs support for resolve(); thanks krzysiumed for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17517 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Timo Graham 2012-02-12 17:10:31 +00:00
parent d1f8555500
commit 2df1847c9b
1 changed files with 5 additions and 0 deletions

View File

@ -846,6 +846,11 @@ This ``current_app`` argument is used as a hint to resolve application
namespaces into URLs on specific application instances, according to the namespaces into URLs on specific application instances, according to the
:ref:`namespaced URL resolution strategy <topics-http-reversing-url-namespaces>`. :ref:`namespaced URL resolution strategy <topics-http-reversing-url-namespaces>`.
You can use ``kwargs`` instead of ``args``, for example::
>>> reverse('admin:app_list', kwargs={'app_label': 'auth'})
'/admin/auth/'
``args`` and ``kwargs`` cannot be passed to ``reverse()`` at the same time. ``args`` and ``kwargs`` cannot be passed to ``reverse()`` at the same time.
.. admonition:: Make sure your views are all correct. .. admonition:: Make sure your views are all correct.