[Django] #29107: ModelForm is not a subclass of Form

6 views
Skip to first unread message

Django

unread,
Feb 2, 2018, 1:13:47 PM2/2/18
to django-...@googlegroups.com
#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.

--
Ticket URL: <https://code.djangoproject.com/ticket/29107>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 3, 2018, 3:16:28 PM2/3/18
to django-...@googlegroups.com
#29107: Document that ModelForm isn't actually a subclass of Form
-------------------------------------+-------------------------------------
Reporter: Haydar Al-Rikabi | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 2.0
Severity: Normal | Resolution:
Keywords: ModelForm, Form, | Triage Stage: Accepted
subclass |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/9658 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/29107#comment:1>

Django

unread,
Feb 8, 2018, 10:10:45 AM2/8/18
to django-...@googlegroups.com
#29107: Document that ModelForm isn't actually a subclass of Form
-------------------------------------+-------------------------------------

Reporter: Haydar Al-Rikabi | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 2.0
Severity: Normal | Resolution: fixed

Keywords: ModelForm, Form, | Triage Stage: Accepted
subclass |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"ff61a250815d32ff185501a5afef0245fec7d878" ff61a25]:
{{{
#!CommitTicketReference repository=""
revision="ff61a250815d32ff185501a5afef0245fec7d878"
Fixed #29107 -- Doc'd that ModelForm doesn't actually inherit from Form.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29107#comment:2>

Django

unread,
Feb 8, 2018, 10:11:11 AM2/8/18
to django-...@googlegroups.com
#29107: Document that ModelForm isn't actually a subclass of Form
-------------------------------------+-------------------------------------

Reporter: Haydar Al-Rikabi | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 2.0
Severity: Normal | Resolution: fixed
Keywords: ModelForm, Form, | Triage Stage: Accepted
subclass |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"29dd7dcdfdf63e6e2b127273c58f55e81fc7c2e2" 29dd7dcd]:
{{{
#!CommitTicketReference repository=""
revision="29dd7dcdfdf63e6e2b127273c58f55e81fc7c2e2"
[2.0.x] Fixed #29107 -- Doc'd that ModelForm doesn't actually inherit from
Form.

Backport of ff61a250815d32ff185501a5afef0245fec7d878 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29107#comment:3>

Reply all
Reply to author
Forward
0 new messages