Opened 8 years ago

Closed 8 years ago

#15282 closed (invalid)

inlineformset_factory ignores overrides on base_fields when a form class is passed in

Reported by: coleifer Owned by: nobody
Component: Forms Version: 1.2
Severity: Keywords: inlineformset_factory, ModelFormMetaclass
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When using inlineformset_factory with your own Form class, any overrides present in the base_fields do not carry over to the form of the generated formset.

Looking at if a declared_field is overridden it will be updated correctly, but updates to base_fields do not.

My specific use-case: hooking into the admin inline's get_formset() method, I want to be able to alter the queryset of certain inline form fields on a per-request basis. Code here

Attachments (2)

testcase.diff (1.6 KB) - added by coleifer 8 years ago.
testcase indicating failure
patch.diff (751 bytes) - added by coleifer 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by coleifer

Attachment: testcase.diff added

testcase indicating failure

Changed 8 years ago by coleifer

Attachment: patch.diff added


comment:1 Changed 8 years ago by coleifer

Has patch: set

comment:2 Changed 8 years ago by anonymous

Resolution: invalid
Status: newclosed

base_fields is not a public API, so this isn't a bug. Reopen if there's a manifestation of the issue that can be triggered without poking directly at base_fields.

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