Opened 14 years ago
Closed 13 years ago
#16016 closed New feature (duplicate)
There should be a way to perform operations once the admin is done with a form
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | 1.3 |
Severity: | Normal | Keywords: | m2m admin |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently, adding m2m relationships programatically on a model save() is tricky if you want to use the admin: the admin calls save_m2m that clear the relationship and don't let you to hook something easily after that.
You can see the problem here:
http://stackoverflow.com/questions/4432385/django-how-to-save-m2m-data-via-post-save-signal
And here as well, with a workaround:
http://stackoverflow.com/questions/3652585/simple-django-form-model-save-question
Some kind of after_form_save signal would be great for this situation.
Change History (4)
comment:1 by , 14 years ago
Component: | Uncategorized → contrib.admin |
---|
comment:2 by , 14 years ago
Summary: | There should be a way to perform operations once the admin si done with a form → There should be a way to perform operations once the admin is done with a form |
---|
comment:3 by , 13 years ago
Closing this as a duplicate of #16115 which, although newer, formulates the feature a bit more clearly and has a patch.
comment:4 by , 13 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Wouldn't it be an easier and cleaner work-around to alter the form's values from inside the
ModelAdmin.save_model()
hook?