Kaydet (Commit) 64ee097b authored tarafından Niclas Åhdén's avatar Niclas Åhdén

Fixed #22639 -- Added missing imports in docs

Added ModelForm and NON_FIELD_ERRORS imports.
üst bb0a9a07
......@@ -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
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 Meta:
error_messages = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment