Opened 15 years ago
Last modified 15 years ago
#13878 new New feature
Formset validation refactoring and valid_forms property of fieldsets
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
This series of patch solves two problems:
- Formsets validation is spread in four different methods so it is very difficult to comprehend the code and to solve possible problems.
- There is no method which gives valid forms in all situation - especially, valid formset can contain invalid form if this form should be deleted. So this ticket adds new property valid_forms which returns all valid (and filled) forms, possible ordered.
There is wiki page and discussion in django-developers:
Attachments (6)
Change History (11)
by , 15 years ago
| Attachment: | 01-formset-refactoring.diff added |
|---|
by , 15 years ago
| Attachment: | 02-formset-refactoring-cleaned-data-tests.diff added |
|---|
by , 15 years ago
| Attachment: | 03-formset-refactoring-valid-forms-tests.diff added |
|---|
comment:1 by , 15 years ago
by , 15 years ago
| Attachment: | 01-formset-refactoring.2.diff added |
|---|
by , 15 years ago
| Attachment: | 02-formset-refactoring-cleaned-data-tests.2.diff added |
|---|
by , 15 years ago
| Attachment: | 03-formset-refactoring-valid-forms-tests.2.diff added |
|---|
comment:2 by , 15 years ago
| Patch needs improvement: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Marking accepted on the basis of the discussion on django-dev -- on principle, this sounds like a reasonable idea, but it needs a *very* detailed review. Widespread changes of this nature make me *very* nervous about backwards compatibility issues. The test coverage you have provided is a very good start, but I don't have complete confidence that the existing test suite covers all possible backwards compatibility issues.
Speaking of which -- the tests need to be updated to unittests; the patches don't currently apply cleanly.
comment:3 by , 15 years ago
| Severity: | → Normal |
|---|---|
| Type: | → New feature |
The first patch (01-formset-refactoring.diff) contains changes of code. The second patch (02-formset-refactoring-cleaned-data-tests.diff) shows that cleaned_data as attribute of formsets or forms in formsets are problematic (this patch could be applied to trunk to expose the situation). The third patch (03-formset-refactoring-valid-forms-tests.diff) contains tests for new property valid_forms.