#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: 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 19 months ago by brunato

  • Cc brunato added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Type changed from Uncategorized to Cleanup/optimization

comment:2 Changed 19 months ago by timo

  • Resolution set to wontfix
  • Status changed from new to closed

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