#16653 closed Cleanup/optimization (fixed)
Document kwargs support for urlresolvers.resolve
Reported by: | jedie | Owned by: | Christopher Medrela |
---|---|---|---|
Component: | Documentation | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | krzysiumed@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The section "Reversing admin URLs" on the page https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#reversing-admin-urls should IMHO clarify that the parameters must be used as the keyword argument "args", e.g.:
-
docs/ref/contrib/admin/index.txt
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index beff94e..d8cdd3c 100644
a b accessible using Django's :ref:`URL reversing system <naming-url-patterns>`. 1696 1696 The :class:`AdminSite` provides the following named URL patterns: 1697 1697 1698 1698 ====================== ======================== ============= 1699 Page URL name Parameters1699 Page URL name args 1700 1700 ====================== ======================== ============= 1701 1701 Index ``index`` 1702 1702 Logout ``logout`` … … The :class:`AdminSite` provides the following named URL patterns: 1706 1706 Application index page ``app_list`` ``app_label`` 1707 1707 ====================== ======================== ============= 1708 1708 1709 Example go get the index page of the auth contrib app:: 1710 1711 >>> from django.core import urlresolvers 1712 >>> app_index_url = urlresolvers.reverse('admin:app_list', args=('auth',)) 1713 1709 1714 Each :class:`ModelAdmin` instance provides an additional set of named URLs: 1710 1715 1711 1716 ====================== =============================================== ============= 1712 Page URL name Parameters1717 Page URL name args 1713 1718 ====================== =============================================== ============= 1714 1719 Changelist ``{{ app_label }}_{{ model_name }}_changelist`` 1715 1720 Add ``{{ app_label }}_{{ model_name }}_add``
Attachments (1)
Change History (8)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Patch needs improvement: | set |
---|---|
Summary: | Clarify "Reversing admin URLs" in docu... → Document kwargs support for urlresolvers.resolve |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
I agree that kwargs support should be documented, but the best place for it probably is in https://docs.djangoproject.com/en/dev/topics/http/urls/#django.core.urlresolvers.reverse, since the admin doc already links to it anyway.
by , 13 years ago
Attachment: | 16653.diff added |
---|
comment:3 by , 13 years ago
Owner: | changed from | to
---|---|
Patch needs improvement: | unset |
Status: | new → assigned |
comment:4 by , 13 years ago
Cc: | added |
---|
comment:5 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
Hm. We can use "Parameters" as args and as kwargs. So renaming "Parameters" to "args" ist wrong.
But for clarify it's IMHO usefull we have a example which used 'kwargs' (There is already an example with 'args').
I would suggest this:
docs/ref/contrib/admin/index.txt