I'm trying to set field errors in a form clean() and I'm currently doing:
self._errors['address'] = self._errors.get('address', ErrorList())
self._errors['address'].append(_(u'Please specify an address.'))
Is there a better and if possible shorter method for doing this?
New in Django 1.7 is Form.add_error( field, message )
.
https://docs.djangoproject.com/en/dev/ref/forms/api/#django.forms.Form.add_error