Opened 17 years ago

Closed 16 years ago

#5829 closed (wontfix)

Return to the calling page from a generic view

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

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 by Matt McClanahan, 16 years ago

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 by Jacob, 16 years ago

Resolution: wontfix
Status: newclosed

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