From aa9a146a69655849d588da7eba4a71a2ea4b6361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niclas=20=C3=85hd=C3=A9n?= Date: Wed, 21 May 2014 17:11:01 +0200 Subject: [PATCH] [1.7.x] Fixed #22639 -- Added missing imports in docs Added ModelForm and NON_FIELD_ERRORS imports. Backport of 64ee097b3b from master --- docs/topics/forms/modelforms.txt | 3 +++ 1 file changed, 3 insertions(+) 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 = {