#14099 closed (fixed)
modelformset not using _should_delete_form
| Reported by: | kenth | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | sprintSep2010 | |
| Cc: | kenth | 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 BaseModelFormSet class doesn't use the BaseFormSet method _should_delete_form when deciding if a form should be deleted. Instead it roots around in the form raw_data for the field that BaseFormSet added. This also makes it difficult to override _should_delete_form.
This patch makes BaseModelFormSet use the BaseFormSet method.
Attachments (3)
Change History (13)
by , 15 years ago
| Attachment: | model-formset-delete.diff added |
|---|
comment:1 by , 15 years ago
| Has patch: | set |
|---|
comment:2 by , 15 years ago
| Component: | Uncategorized → Forms |
|---|---|
| Version: | 1.2 → SVN |
comment:4 by , 15 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
by , 15 years ago
| Attachment: | 14099-PEP8.patch added |
|---|
Small PEP8 cleanup of kenth's original patch (vs [13749])
comment:5 by , 15 years ago
| Keywords: | sprintSep2010 added |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
I did remove a couple stray spaces in the patch but it looks good. No regression tests are broken by the change and it makes the internals of BaseModelFormSet consistent with BaseFormSet as expected given the inheritance. I would say this is RFC.
comment:6 by , 15 years ago
| Needs tests: | set |
|---|---|
| Triage Stage: | Ready for checkin → Accepted |
This isn't RFC. It doesn't contain any tests.
comment:7 by , 15 years ago
| Needs tests: | unset |
|---|
comment:8 by , 15 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
New patch has tests; back to RFC.
patch for BaseModelFormSet to use BaseFormSet._should_delete_form