Opened 17 years ago
Closed 17 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 , 17 years ago
comment:2 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → 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.
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.