mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and added '__all__' shortcut
This also updates all dependent functionality, including modelform_factory and modelformset_factory, and the generic views `ModelFormMixin`, `CreateView` and `UpdateView` which gain a new `fields` attribute.
This commit is contained in:
@@ -25,6 +25,14 @@ Model Form Functions
|
||||
|
||||
See :ref:`modelforms-factory` for example usage.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
You must provide the list of fields explicitly, either via keyword arguments
|
||||
``fields`` or ``exclude``, or the corresponding attributes on the form's
|
||||
inner ``Meta`` class. See :ref:`modelforms-selecting-fields` for more
|
||||
information. Omitting any definition of the fields to use will result in all
|
||||
fields being used, but this behaviour is deprecated.
|
||||
|
||||
.. function:: modelformset_factory(model, form=ModelForm, formfield_callback=None, formset=BaseModelFormSet, extra=1, can_delete=False, can_order=False, max_num=None, fields=None, exclude=None, widgets=None, validate_max=False)
|
||||
|
||||
Returns a ``FormSet`` class for the given ``model`` class.
|
||||
|
||||
Reference in New Issue
Block a user