Opened 18 years ago
Closed 17 years ago
#4103 closed (fixed)
Add "reverse" to url_dispatch documentation for named url patterns
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | docs, url_dispatch | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Just a small addition to the documentation for accessing named URL patterns at:
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
See email exchange between myself and Malcolm below...
On Sat, 2007-04-21 at 01:47 -0700, Michael wrote:
I'm not sure if this is obvious, but the documentation at:
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
doesn't mention how you can use your named URL patters to redirect
from one view to another. It only shows how you can get the url for a
view from within a template.
Anyways, turns out to be pretty simple (found it in the source
django_src/django/template/defaulttags.py):
from django.core.urlresolvers import reverse
return HttpResponseRedirect( reverse( 'your-url-name' ) )
Have I missed something and this was documented else where? Otherwise
I'll raise a ticket to update the above documentation for named url
patterns...
We haven't documented reverse() anywhere, as far as I know. So worth
filing a ticket.
Thanks,
Malcolm
Attachments (2)
Change History (6)
comment:1 by , 18 years ago
Keywords: | docs url_dispatch added |
---|---|
Needs documentation: | set |
Summary: | Addition to url_dispatch documentation for named url patterns → Add "reverse" to url_dispatch documentation for named url patterns |
Triage Stage: | Unreviewed → Accepted |
by , 18 years ago
Attachment: | url_dispatch.diff added |
---|
by , 18 years ago
Attachment: | url_dispatch2.diff added |
---|
comment:2 by , 18 years ago
comment:3 by , 18 years ago
Has patch: | set |
---|
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Here's a first attempt - what else needs to be commented? (take the second patch, the first has some crud in there from something else).