Opened 12 years ago

Last modified 10 years ago

#18558 closed New feature

Supply `url` property to `HttpResponseRedirect` and `HttpResponsePermanentRedirect` — at Version 2

Reported by: Ram Rachum Owned by: nobody
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: hirokiky@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Jannis Leidel)

Currently the way to get the URL that a HttpResponseRedirect is redirecting to requires doing response['Location']. This is not so intuitive. There's no reason to remember the HTML header name when dealing with a redirect response.

Instead I propose this property:

url = property(lambda self: self['Location'])

Change History (2)

comment:1 by Ram Rachum, 12 years ago

Sorry for the butchered Python, I meant:

    url = property(lambda self: self['Location'])

comment:2 by Jannis Leidel, 12 years ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted
Type: UncategorizedNew feature

Formatting updates.

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