mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields
This commit is contained in:
@@ -318,6 +318,13 @@ Minor features
|
||||
* Formsets now have a
|
||||
:meth:`~django.forms.formsets.BaseFormSet.total_error_count` method.
|
||||
|
||||
* :class:`~django.forms.ModelForm` fields can now override error messages
|
||||
defined in model fields by using the
|
||||
:attr:`~django.forms.Field.error_messages` argument of a ``Field``'s
|
||||
constructor. To take advantage of this new feature with your custom fields,
|
||||
:ref:`see the updated recommendation <raising-validation-error>` for raising
|
||||
a ``ValidationError``.
|
||||
|
||||
Backwards incompatible changes in 1.6
|
||||
=====================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user