Opened 15 years ago
Last modified 15 years ago
#15256 closed
FormSet does not respect initial values after binding — at Initial Version
| Reported by: | mnbayazit | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | formset | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
After the form is posted, if an empty form is generated, it will be completely empty rather than having the initial values specified on the form. I believe we can fix this by modifying _construct_form like so:
if self.is_bound and i < self.initial_form_count():
And completely remove this chunk from _get_empty_form
if self.is_bound:
I don't know why an empty form should behave any differently after the formset has been bound... it only seems to be causing problems.
Note:
See TracTickets
for help on using tickets.