diff options
| author | Niclas Åhdén <niclas@brightweb.se> | 2014-05-21 17:11:01 +0200 |
|---|---|---|
| committer | Niclas Åhdén <niclas@brightweb.se> | 2014-05-21 17:11:01 +0200 |
| commit | 64ee097b3b33716b10837644f9e18b87f25d606e (patch) | |
| tree | 65ef19a522a42ca0311fcc9ea23e6c5c435f4526 | |
| parent | bb0a9a070b9570c85bcb17346dae6513e4ba6e76 (diff) | |
Fixed #22639 -- Added missing imports in docs
Added ModelForm and NON_FIELD_ERRORS imports.
| -rw-r--r-- | docs/topics/forms/modelforms.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index 87f7c2e952..e96345f155 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 = { |
