modelformset_factory examples in documentation do not specify a field list
Several of the examples for modelformset_factory in the documentation now fail in Django 1.8, because they do not pass a 'fields' or 'exclude' parameter (either directly to the modelformset_factory function, or indirectly by specifying a ModelForm subclass).
For example: https://github.com/django/django/blob/a15aba66f2fc650f70a791fb7fa880cf85cb1229/docs/topics/forms/modelforms.txt#L717
>>> from django.forms.models import modelformset_factory
>>> from myapp.models import Author
>>> AuthorFormSet = modelformset_factory(Author)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/matthew/.virtualenvs/dj18/lib/python2.7/site-packages/django/forms/models.py", line 827, in modelformset_factory
"Calling modelformset_factory without defining 'fields' or "
ImproperlyConfigured: Calling modelformset_factory without defining 'fields' or 'exclude' explicitly is prohibited.
Change History
(5)
Owner: |
changed from nobody to Matt Westcott
|
Status: |
new → assigned
|
Triage Stage: |
Unreviewed → Accepted
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
PR: https://github.com/django/django/pull/4024
I've slightly reshuffled the docs to explain the 'fields' / 'exclude' parameters up-front, rather than in their own section. (I also fixed a reference in the ModelForm docs which was wrongly pointing to that now-deleted section.)