Opened 17 months ago

Last modified 13 months ago

#26607 new New feature

Add a hook to customize the admin's formsets parameters

Reported by: David Sanders Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords: admin inline formset initial
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

New feature that adds a method on InlineModelAdmin for providing initial data for the inline formset. By default there is no implementation, although one could be implemented to use GET parameters like get_changeform_initial_data, but it wouldn't be trivial due to the list nature of formset initial data.

Change History (3)

comment:1 Changed 17 months ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:2 Changed 17 months ago by Philip James

Patch needs improvement: set

Currently the PR has merge conflicts

comment:3 Changed 13 months ago by Tim Graham

Summary: Add InlineModelAdmin.get_formset_initial_data().Add a hook to customize the admin's formsets parameters

I think we should add a more general customization hook that allows customizing the parameters passed to the formset initialization (which includes initial data). That could also allow the use case of #27240 which requires adding form_kwargs': {'request': request} to formset_params.

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