Opened 11 years ago

Closed 11 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

Description

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 by Davide Brunato, 11 years ago

Cc: Davide Brunato added
Type: UncategorizedCleanup/optimization

comment:2 by Tim Graham, 11 years ago

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