Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13002 closed (fixed)

InlineModelAdmin 'form' option defaults to ModelForm, not BaseModelForm

Reported by: stijn@… Owned by: nobody
Component: Documentation Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

While messing around a bit with admin customization, I noticed that the form option in an InlineModelAdmin actually defaults to ModelForm, and not BaseModelForm as the documentation mentions. Explicitly setting 'form' to BaseModelAdmin gives rise to assorted errors in the admin (e.g. "... has no attribute _meta ...") whereas setting it to ModelForm works without a hitch, which leads me to believe that there is no magic going on and that this is just a little factual error in the docs.

The specific doc page I'm talking about is this one: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#form

Attachments (1)

13002.diff (487 bytes) - added by Tim Graham 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 in reply to:  description Changed 7 years ago by anonymous

Err, of course I meant "explicitly setting 'form' to BaseModelForm" and not "explicitly setting 'form' to BaseModelAdmin".

Replying to stijn@typograaf.be:

While messing around a bit with admin customization, I noticed that the form option in an InlineModelAdmin actually defaults to ModelForm, and not BaseModelForm as the documentation mentions. Explicitly setting 'form' to BaseModelAdmin gives rise to assorted errors in the admin (e.g. "... has no attribute _meta ...") whereas setting it to ModelForm works without a hitch, which leads me to believe that there is no magic going on and that this is just a little factual error in the docs.

The specific doc page I'm talking about is this one: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#form

comment:2 Changed 7 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

Changed 7 years ago by Tim Graham

Attachment: 13002.diff added

comment:3 Changed 7 years ago by Tim Graham

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13209]) Fixed #13002 -- Corrected description of the default form base class in InlineModelAdmin classes. Thanks to stijn@… for the report, and timo for the patch.

comment:5 Changed 7 years ago by Russell Keith-Magee

(In [13214]) [1.1.X] Fixed #13002 -- Corrected description of the default form base class in InlineModelAdmin classes. Thanks to stijn@… for the report, and timo for the patch.

Backport of r13209 from trunk.

Note: See TracTickets for help on using tickets.
Back to Top