diff options
| author | Berker Peksag <berker.peksag@gmail.com> | 2014-11-15 13:17:55 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-11-21 14:23:17 -0500 |
| commit | 343162410f9270012e4fdd8396d542b39cc63269 (patch) | |
| tree | d779c67fa55404cb50243034623f13e1edddf057 /docs | |
| parent | 5b26a014a81ba0d404d46e11d2b45c01d92b97e5 (diff) | |
Fixed #21753 -- Raised exception when both `form_class` and `fields` are specified.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/class-based-views/mixins-editing.txt | 11 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 5 | ||||
| -rw-r--r-- | docs/topics/class-based-views/generic-editing.txt | 9 |
3 files changed, 25 insertions, 0 deletions
diff --git a/docs/ref/class-based-views/mixins-editing.txt b/docs/ref/class-based-views/mixins-editing.txt index 1a06e2bb97..3dcf28dae3 100644 --- a/docs/ref/class-based-views/mixins-editing.txt +++ b/docs/ref/class-based-views/mixins-editing.txt @@ -115,6 +115,17 @@ ModelFormMixin :attr:`~django.views.generic.detail.SingleObjectMixin.queryset` attributes, describing the type of object that the ``ModelForm`` is manipulating. + If you specify both the + :attr:`~django.views.generic.edit.ModelFormMixin.fields` and + :attr:`~django.views.generic.edit.FormMixin.form_class` attributes, an + :exc:`~django.core.exceptions.ImproperlyConfigured` exception will be + raised. + + .. versionchanged:: 1.8 + + Previously if both ``fields`` and ``form_class`` were specified, + ``fields`` was silently ignored. + **Mixins** * :class:`django.views.generic.edit.FormMixin` diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 41a0be4ecc..3175eecf5f 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -783,6 +783,11 @@ Miscellaneous ``<WSGIRequest: GET '/somepath/'>``). This won't change the behavior of the :class:`~django.views.debug.SafeExceptionReporterFilter` class. +* Class-based views that use :class:`~django.views.generic.edit.ModelFormMixin` + will raise an :exc:`~django.core.exceptions.ImproperlyConfigured` exception + when both the ``fields`` and ``form_class`` attributes are specified. + Previously, ``fields`` was silently ignored. + .. _deprecated-features-1.8: Features deprecated in 1.8 diff --git a/docs/topics/class-based-views/generic-editing.txt b/docs/topics/class-based-views/generic-editing.txt index 8490f0d4fb..be087d7758 100644 --- a/docs/topics/class-based-views/generic-editing.txt +++ b/docs/topics/class-based-views/generic-editing.txt @@ -139,11 +139,20 @@ inner ``Meta`` class on :class:`~django.forms.ModelForm`. Unless you define the form class in another way, the attribute is required and the view will raise an :exc:`~django.core.exceptions.ImproperlyConfigured` exception if it's not. +If you specify both the :attr:`~django.views.generic.edit.ModelFormMixin.fields` +and :attr:`~django.views.generic.edit.FormMixin.form_class` attributes, an +:exc:`~django.core.exceptions.ImproperlyConfigured` exception will be raised. + .. versionchanged:: 1.8 Omitting the ``fields`` attribute was previously allowed and resulted in a form with all of the model's fields. +.. versionchanged:: 1.8 + + Previously if both ``fields`` and ``form_class`` were specified, + ``fields`` was silently ignored. + Finally, we hook these new views into the URLconf: .. snippet:: |
