summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiclas Åhdén <niclas@brightweb.se>2014-05-21 17:11:01 +0200
committerTim Graham <timograham@gmail.com>2014-05-21 11:20:38 -0400
commitaa9a146a69655849d588da7eba4a71a2ea4b6361 (patch)
tree808dcd38eb337d2889133e757f50b2a9d8b1c932
parentf25c5de4ceb1f75a58acc6364c7e8a9b217bc08c (diff)
[1.7.x] Fixed #22639 -- Added missing imports in docs
Added ModelForm and NON_FIELD_ERRORS imports. Backport of 64ee097b3b from master
-rw-r--r--docs/topics/forms/modelforms.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt
index a317ecace6..9cd0223ea4 100644
--- a/docs/topics/forms/modelforms.txt
+++ b/docs/topics/forms/modelforms.txt
@@ -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 = {