Opened 18 years ago

Closed 17 years ago

#4103 closed (fixed)

Add "reverse" to url_dispatch documentation for named url patterns

Reported by: absoludity@… 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)

url_dispatch.diff (1.6 KB ) - added by Simon G. <dev@…> 18 years ago.
url_dispatch2.diff (733 bytes ) - added by Simon G. <dev@…> 18 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Simon G. <dev@…>, 18 years ago

Keywords: docs url_dispatch added
Needs documentation: set
Summary: Addition to url_dispatch documentation for named url patternsAdd "reverse" to url_dispatch documentation for named url patterns
Triage Stage: UnreviewedAccepted

by Simon G. <dev@…>, 18 years ago

Attachment: url_dispatch.diff added

by Simon G. <dev@…>, 18 years ago

Attachment: url_dispatch2.diff added

comment:2 by Simon G. <dev@…>, 18 years ago

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).

comment:3 by Simon G. <dev@…>, 18 years ago

Has patch: set

comment:4 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5362]) Added documentation for reverse() (based on a patch from Simon Greenhill) and
another cross-reference to permalink(). Fixed #4103.

Note: See TracTickets for help on using tickets.
Back to Top