Opened 8 years ago

Closed 7 years ago

#5829 closed (wontfix)

Return to the calling page from a generic view

Reported by: anonymous Owned by: nobody
Component: Generic views Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

It would be nice if you could go from a generic view (e.g. create_object) defined in urls.py back to the page from which it was called for instance by using a special keyword for the post_save_redirect parameter. This would be very helpful, for example, if you are in a detail view of a certain item which then should be linked to another item that first have to be created. In this case you would click on "create item" and after entering and confirming the new data you would return to the calling page...

Change History (2)

comment:1 Changed 8 years ago by mattmcc

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This would be quite simple to do with a wrapper to the generic view using post_save_redirect=request.METAHTTP_REFERER? as a keyword argument. Additionally, this behavior is quite unreliable, since the Referer header can easily be spoofed or omitted entirely.

comment:2 Changed 7 years ago by jacob

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

Yeah, I don't want to code any behavior that depends on referrers into Django; it's just too fragile. This idea is a perfect candidate for your own wrapper around a generic view.

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