Opened 17 years ago

Closed 17 years ago

#5175 closed (invalid)

Formsets - formset.required_forms not implemented?

Reported by: Simon Litchfield <simon@…> 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)

formsets-required_forms-5897.diff (2.5 KB ) - added by Simon Litchfield <simon@…> 17 years ago.
Adds formset.formset_errors ErrorList if number of required_forms is not met
formsets-required_forms-5897b.diff (2.8 KB ) - added by Simon Litchfield <simon@…> 17 years ago.
(ignore previous) Adds formset.formset_errors ErrorList if number of required_forms is not met
formsets-required_forms-5897c.diff (2.8 KB ) - added by Simon Litchfield <simon@…> 17 years ago.
(ignore previous!!!) Adds formset.formset_errors ErrorList if number of required_forms is not met
formsets-required_forms2-5897.diff (2.8 KB ) - added by Simon Litchfield <simon@…> 17 years ago.
USE THIS ONE
required_forms-formsets.diff (2.8 KB ) - added by Simon Litchfield <simon@…> 17 years ago.
USE THIS ONE

Download all attachments as: .zip

Change History (7)

by Simon Litchfield <simon@…>, 17 years ago

Adds formset.formset_errors ErrorList if number of required_forms is not met

by Simon Litchfield <simon@…>, 17 years ago

(ignore previous) Adds formset.formset_errors ErrorList if number of required_forms is not met

by Simon Litchfield <simon@…>, 17 years ago

(ignore previous!!!) Adds formset.formset_errors ErrorList if number of required_forms is not met

by Simon Litchfield <simon@…>, 17 years ago

USE THIS ONE

by Simon Litchfield <simon@…>, 17 years ago

USE THIS ONE

comment:1 by Simon Litchfield <simon@…>, 17 years ago

Has patch: set
Triage Stage: UnreviewedDesign 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 jkocherhans, 17 years ago

Resolution: invalid
Status: newclosed

formset.required_forms is not meant to be a public attribute. Setting it would have unpredictable results. That said, FormSets 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.

Note: See TracTickets for help on using tickets.
Back to Top