Opened 14 years ago
Closed 14 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 |
Description
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 http://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L216 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 http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L1297
Attachments (2)
Change History (4)
by , 14 years ago
Attachment: | testcase.diff added |
---|
comment:1 by , 14 years ago
Has patch: | set |
---|
comment:2 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
testcase indicating failure