#8001 closed New feature (fixed)
Make redirection URLs customizable in ModelAdmin views
Reported by: | Julien Phalip | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As originated in [1], the ModelAdmin
's save_add
method has a post_url_continue
argument to customize what page you should be
redirected to after saving a new object. This is very useful, but all other redirects are hard coded in all the views, including the save_add
and save_change
methods. Currently, those methods assume that there is only one standard way to route URLs in admin. This is a major drawback if you want to customize the URL scheme of your application's admin.
The proposed patch moves all hard-coded URLs to arguments of the corresponding methods. Those arguments are set to a default value, so the change is backward compatible. The benefit here, is that you can re-use the views and control where the user is redirected to after the view is processed.
[1] http://groups.google.com/group/django-developers/browse_thread/thread/e962ceb9478a167a
Attachments (4)
Change History (15)
by , 16 years ago
Attachment: | 8001.admin_urls.diff added |
---|
comment:1 by , 16 years ago
milestone: | → 1.0 maybe |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 16 years ago
milestone: | 1.0 maybe → post-1.0 |
---|---|
Triage Stage: | Design decision needed → Accepted |
comment:4 by , 13 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:5 by , 13 years ago
Easy pickings: | unset |
---|---|
Needs tests: | set |
See also #15294 for a related feature request.
by , 13 years ago
Attachment: | 8001_redirection_backward_compatibility.diff added |
---|
by , 13 years ago
Attachment: | 8001_redirection.diff added |
---|
comment:7 by , 12 years ago
I've attached a patch for this. Mostly to know if I'm interpreting Julien and Russell (in #18310) correctly and to start discussion about if this is an approach we want to pursue.
comment:8 by , 12 years ago
Work is ready for review in this branch https://github.com/ramiro/django/compare/master...8001_18310
comment:9 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This is a good idea and something needed by the admin, but as a "feature addition" it's a post-1.0 thing.