#15349 closed (fixed)
Bound FormSet produces bound empty_form
Reported by: | hidde-jan | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | formset, is_bound, empty_form | |
Cc: | carl.j.meyer@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The current implementation of BaseFormSet
provides a method _get_empty_form
. When a formset is bound, it supplies the data and files it received to the formclass. This results in the formset's empty_form being bound. This can lead to unexpected behaviour, especially when subclassing forms.Form
.
The supplied patch has the fix and a test that checks wether the empty_form of a bound formset is still unbound.
Since the empty_form property was added for use as a template, there should be no difference, whatsoever, between the empty_form of a bound and an unbound formset.
Attachments (1)
Change History (5)
by , 14 years ago
Attachment: | unbound_empty_forms.diff added |
---|
comment:1 by , 14 years ago
Version: | 1.2 → SVN |
---|
comment:2 by , 14 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In [15614]: