Re: Add newform errors directly (without using ValidationError)

2008-03-27 Thread Thomas Guettler
Simon Litchfield schrieb: > I tend to think there needs to be a documented, 'clean' way of adding > non_field_errors (and even field errors too) to forms, *outside* the > clean() methods. > > I had this idea some time ago, too. There is a patch with documentation and unittest: http://code.dja

Re: Add newform errors directly (without using ValidationError)

2008-03-26 Thread Simon Litchfield
Instead of -- form.errors['my_file_field'] = forms.util.ErrorList([u'Some error in processing file']) Maybe something more like -- form.add_error('Some error in processing file', 'my_file_field') And with a nice simple default to non_field_errors -- form.add_error('A general form error message')

Add newform errors directly (without using ValidationError)

2008-03-26 Thread Simon Litchfield
I tend to think there needs to be a documented, 'clean' way of adding non_field_errors (and even field errors too) to forms, *outside* the clean() methods. Currently, I believe the only 'right' way to add errors is by raising a ValidationError. This is suitable for 'contained' and relatively simp