#29107 closed Bug (fixed)
Document that ModelForm isn't actually a subclass of Form
Description ¶
In the Django docs, I've read the following statement:
All form classes are created as subclasses of django.forms.Form, including the ModelForm, which you encounter in Django’s admin.
I believe that the above statement is wrong because as the Django project on Github does not show that ModelForm is a subclass of django.forms.Form.
in /django/forms/models.py the class ModelForm is subclass of BaseModelForm which is also a subclass of BaseForm (located in /django/forms/forms.py).
in /django/forms/forms.py the class Form is a subclass of BaseForm.
So, as you can see, both django.forms.Form and django.forms.ModelForm are subclasses of BaseForm, but ModelForm is not a subclass of Form as the docs state.
Change History (3)
comment:1 by , 7 years ago
Has patch: | set |
---|---|
Summary: | ModelForm is not a subclass of Form → Document that ModelForm isn't actually a subclass of Form |
Triage Stage: | Unreviewed → Accepted |
PR