djangodocs.org

1293 sections across all versions Narrow to Django 6.0 (current) →

Form.add_error()

Release notes Django 1.7 release notes What’s new in Django 1.7Improvements to Form error handling

Previously there were two main patterns for handling errors in forms: Raising a ValidationError from within certain functions (e.g.

4.2 5.0 5.1 5.2 6.0

Model validation

Release notes Django 1.2 release notes

Model instances now have support for validating their own data, and both model and form fields now accept configurable lists of validators specifying reusable, encapsulated validation behavior. Note, however, that validation must still be performed explicitly.

dev

Model validation

Release notes Django 1.2 release notes What’s new in Django 1.2

Model instances now have support for validating their own data, and both model and form fields now accept configurable lists of validators specifying reusable, encapsulated validation behavior. Note, however, that validation must still be performed explicitly.

4.2 5.0 5.1 5.2 6.0

Forms

Release notes Django 1.10 release notes

Form and widget Media is now served using django.contrib.staticfiles if installed. The <input> tag rendered by CharField now includes a minlength attribute if the field has a min_length. Required form fields now have the required HTML attribute.

dev

Forms

Release notes Django 1.10 release notes What’s new in Django 1.10Minor features

Form and widget Media is now served using django.contrib.staticfiles if installed. The <input> tag rendered by CharField now includes a minlength attribute if the field has a min_length. Required form fields now have the required HTML attribute.

4.2 5.0 5.1 5.2 6.0

Error metadata

Release notes Django 1.7 release notes What’s new in Django 1.7Improvements to Form error handling

The ValidationError constructor accepts metadata such as error code or params which are then available for interpolating into the error message (see Raising ValidationError for more details); however, before Django 1.7 those metadata were discarded as soon as the errors …

4.2 5.0 5.1 5.2 6.0

Error metadata

Release notes Django 1.7 release notes

The ValidationError constructor accepts metadata such as error code or params which are then available for interpolating into the error message (see Raising ValidationError for more details); however, before Django 1.7 those metadata were discarded as soon as the errors …

dev