Opened 14 years ago

Closed 14 years ago

Last modified 14 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: no UI/UX: no

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 14 years ago.

Download all attachments as: .zip

Change History (6)

in reply to:  description comment:1 by anonymous, 14 years ago

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 by Russell Keith-Magee, 14 years ago

Triage Stage: UnreviewedAccepted

by Tim Graham, 14 years ago

Attachment: 13002.diff added

comment:3 by Tim Graham, 14 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 by Russell Keith-Magee, 14 years ago

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 by Russell Keith-Magee, 14 years ago

(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