#22220 closed Cleanup/optimization (fixed)
reverse() documentation
Reported by: | Daniele Procida | Owned by: | Ben Davis |
---|---|---|---|
Component: | Documentation | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
https://docs.djangoproject.com/en/dev/ref/urlresolvers/#reverse:
reverse(viewname[, urlconf=None, args=None, kwargs=None, current_app=None]) viewname is either the function name (either a function reference, or the string version of the name, if you used that form in urlpatterns) or the URL pattern name.
I think this could be clearer.
- there should be a link to an example of each of the different ways in the documentation (only "URL pattern name" is elucidated this way)
- the phrase "function reference" is confusing; https://docs.djangoproject.com/en/dev/topics/http/urls/#passing-callable-objects-instead-of-strings speaks of "passing objects" for example and the same language should be used in both cases.
And what if one creates a URL pattern name that's the also the string version of the view function name - which would win?
Change History (6)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
Has patch: | set |
---|
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Here's my take on this: https://github.com/django/django/pull/2544