Opened 6 years ago

Closed 6 years ago

#22227 closed Cleanup/optimization (wontfix)

save_model in ModelAdmin with "formsets" parameter

Reported by: anonymous Owned by: nobody
Component: contrib.admin Version: 1.6
Severity: Normal Keywords:
Cc: Davide Brunato Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Can be useful to add a "formsets" parameter in the definition of the method ModelAdmin.save_model, passing it as argument in the save_model calls of add_view and change_view? This new parameter, that can be defaulted to "None" for backward compatibility, could be useful for model admin's customization when a calculated field depends from one or more formsets.

Change History (2)

comment:1 Changed 6 years ago by Davide Brunato

Cc: Davide Brunato added
Type: UncategorizedCleanup/optimization

comment:2 Changed 6 years ago by Tim Graham

Resolution: wontfix
Status: newclosed

Could you put the logic to update the instance in save_formset() instead? That's passed form so you could access form.instance. Adding additional arguments to save_model() will be backwards incompatible for anyone overriding the method.

Note: See TracTickets for help on using tickets.
Back to Top