0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Fixed #22639 -- Added missing imports in docs

Added ModelForm and NON_FIELD_ERRORS imports.
This commit is contained in:
Niclas Åhdén 2014-05-21 17:11:01 +02:00
parent bb0a9a070b
commit 64ee097b3b

View File

@ -281,6 +281,9 @@ You can override the error messages from ``NON_FIELD_ERRORS`` raised by model
validation by adding the :data:`~django.core.exceptions.NON_FIELD_ERRORS` key validation by adding the :data:`~django.core.exceptions.NON_FIELD_ERRORS` key
to the ``error_messages`` dictionary of the ``ModelForm``s inner ``Meta`` class:: to the ``error_messages`` dictionary of the ``ModelForm``s inner ``Meta`` class::
from django.forms import ModelForm
from django.core.exceptions import NON_FIELD_ERRORS
class ArticleForm(ModelForm): class ArticleForm(ModelForm):
class Meta: class Meta:
error_messages = { error_messages = {