newforms-admin: need mechanism for further modifying a newly saved object after it has been saved
|Reported by:||simon||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
ModelAdmin.save_add(...) creates a new_object and then returns an HttpResponseRedirect(). It would be really useful if there was a hook for further modifying that object after it had been saved.
It's possible to do this using a custom save() method on the model at the moment, but that has two limitations:
- The save() method doesn't have access to a request object. Admin customisations often involve extra form stuff being passed in as part of the request.
- You might want custom behaviour that only runs on objects created using the admin, not objects created using other means.
Having a post_save_add() method that is passed the request and the newly created object and does nothing by default (but can be over-ridden in ModelAdmin subclasses) would be one way of solving this, but I'm not sure it's the best way.
Change History (5)
comment:2 Changed 8 years ago by
|Triage Stage:||Unreviewed → Design decision needed|