Opened 8 years ago

Closed 5 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: master
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: UI/UX:

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@…> 8 years ago.
untested code

Download all attachments as: .zip

Change History (5)

comment:1 Changed 8 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from [enhancement] django.views.generic.simple.redirect_to_absolute_url to django.views.generic.simple should have a method to redirect to the absolute_url() of an object
  • Triage Stage changed from Unreviewed to Design decision needed

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

Changed 8 years ago by David Cramer <dcramer@…>

untested code

comment:2 Changed 6 years ago by redbaron

Sounds good, whats problem to include it in mainline?

comment:3 Changed 6 years ago by redbaron

  • Cc ivanov.maxim@… added

comment:4 Changed 5 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

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