Re: Add newform errors directly (without using ValidationError)
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.djangoproject.com/ticket/5335 -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~--~~~~--~~--~--~---
Add newform errors directly (without using ValidationError)
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 simple form field validation, but not for more involved post- processing of forms. This forces us to resort to one of three ugly solutions -- a) hacking them into the form errorlist; or b) duplicate and create an additional passage of returned errors when a perfectly good one exists already; or c) over-complicate by moving post- processing code that belongs in the view into the form. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~--~~~~--~~--~--~---