mirror of
https://github.com/django/django.git
synced 2025-08-30 23:37:50 +00:00
Made ModelForms raise ImproperlyConfigured if the list of fields is not specified.
Also applies to modelform(set)_factory and generic model views. refs #19733.
This commit is contained in:
parent
1c8dbb0cc2
commit
ee4edb1eda
9 changed files with 77 additions and 100 deletions
|
@ -129,15 +129,18 @@ ModelFormMixin
|
|||
|
||||
.. attribute:: fields
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
A list of names of fields. This is interpreted the same way as the
|
||||
``Meta.fields`` attribute of :class:`~django.forms.ModelForm`.
|
||||
|
||||
This is a required attribute if you are generating the form class
|
||||
automatically (e.g. using ``model``). Omitting this attribute will
|
||||
result in all fields being used, but this behavior is deprecated
|
||||
and will be removed in Django 1.8.
|
||||
result in an :exc:`~django.core.exceptions.ImproperlyConfigured`
|
||||
exception.
|
||||
|
||||
.. versionchanged:: 1.8
|
||||
|
||||
Previously, omitting this attribute was allowed and resulted in
|
||||
a form with all fields of the model.
|
||||
|
||||
.. attribute:: success_url
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue