Opened 17 years ago

Closed 14 years ago

#4238 closed (wontfix)

django.views.generic.simple should have a method to redirect to the absolute_url() of an object

Reported by: David Cramer <dcramer@…> Owned by: nobody
Component: Generic views Version: dev
Severity: Keywords:
Cc: ivanov.maxim@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Would be a handy addition to the generic views which would allow you to redirect a URL to the get_absolute_url of an object.

This can be used in many situations, the most common being URL changes.

'/myoldurl/(?P<id>[0-9]+)/', 'django.views.generic.simple.redirect_to_absolute_url', {'pk': '%(id)s'}

Attachments (1)

redirect_to_absolute_url.py (469 bytes ) - added by David Cramer <dcramer@…> 17 years ago.
untested code

Download all attachments as: .zip

Change History (5)

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

Summary: [enhancement] django.views.generic.simple.redirect_to_absolute_urldjango.views.generic.simple should have a method to redirect to the absolute_url() of an object
Triage Stage: UnreviewedDesign decision needed

Sounds like a good idea - want to try and write up an implementation?

by David Cramer <dcramer@…>, 17 years ago

Attachment: redirect_to_absolute_url.py added

untested code

comment:2 by Maxim Ivanov, 15 years ago

Sounds good, whats problem to include it in mainline?

comment:3 by Maxim Ivanov, 15 years ago

Cc: ivanov.maxim@… added

comment:4 by Malcolm Tredinnick, 14 years ago

Resolution: wontfix
Status: newclosed

Not clear this is a common enough use-case to require a function in Django, particularly given the function itself is so short to write.

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