#29107: ModelForm is not a subclass of Form
-------------------------------------+-------------------------------------
Reporter: Haydar | Owner: nobody
Al-Rikabi |
Type: Bug | Status: new
Component: | Version: 2.0
Documentation | Keywords: ModelForm, Form,
Severity: Normal | subclass
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
In the [https://docs.djangoproject.com/en/2.0/topics/forms/#more-about-
django-form-classes 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.