Opened 17 years ago
Closed 17 years ago
#5175 closed (invalid)
Formsets - formset.required_forms not implemented?
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | Version: | newforms-admin |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Design decision needed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Setting formset.required_forms seems to make no difference to formset validation.
I guess we need something similar to ErrorDict to handle formset errors?
Since form errors will most likely be accessed directly, I tend to think the default formset.errors should be reserved for formset errors instead of individual formset errors, or at least a combination of the two.
Then formset.form_errors could be used to return the list of individual forms' errors.
Attachments (5)
Change History (7)
by , 17 years ago
Attachment: | formsets-required_forms-5897.diff added |
---|
by , 17 years ago
Attachment: | formsets-required_forms-5897b.diff added |
---|
(ignore previous) Adds formset.formset_errors ErrorList if number of required_forms is not met
by , 17 years ago
Attachment: | formsets-required_forms-5897c.diff added |
---|
(ignore previous!!!) Adds formset.formset_errors ErrorList if number of required_forms is not met
comment:1 by , 17 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
Excuse the mess, the diff previewer doesn't seem to like my diffs for some reason.
This patch covers 5173, 5174, 5175 (again, excuse, one snag encountered after another).
A couple of other nasty little bugs fixed too.
comment:2 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
formset.required_forms
is not meant to be a public attribute. Setting it would have unpredictable results. That said, FormSet
s still need a hook to do validation on *all* forms in the set. I imagine that's what you want here. I've opened up #5353 to track that. Something like ErrorDict
would probably be useful, but that discussion needs to occur on django-dev. Not enough people will see it here. If you have a design in mind, please propose it there. Otherwise, I'll keep it in mind when I get around to implementing #5353.
Adds formset.formset_errors ErrorList if number of required_forms is not met