Opened 15 years ago

Closed 12 years ago

#11584 closed Cleanup/optimization (wontfix)

Clarify InlineModelAdmin documentation

Reported by: Joseph Long Owned by: nobody
Component: Documentation Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I was just stuck for hours with InlineModelAdmins. I don't often blame the docs, but in this case I genuinely believe they can be made better. I assumed, from the line on http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-options saying "The InlineModelAdmin class is a subclass of ModelAdmin so it inherits all the same functionality as well as some of its own:
" that I was supposed to use admin.site.register() to register my InlineModelAdmin classes as I would a normal ModelAdmin class. As I later learned, defining 'model = ' on the InlineModelAdmin makes registering unnecessary. Ideally, the fact that InlineModelAdmins need not be registered would be noted either at the top of the InlineModelAdmin section or perhaps as an explanatory addition to http://docs.djangoproject.com/en/dev/ref/contrib/admin/#model

Hopefully this will save others some trouble!

(In a separate but related note, the exceptions and behavior one gets when mistakenly admin.site.register()ing an InlineModelAdmin class are completely mystifying. I don't know what the Django policy is for when it's prudent to add checks and exceptions for improper configuration, but one there would have saved me a lot of head-scratching)

Change History (5)

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Julien Phalip, 13 years ago

Severity: Normal
Type: Cleanup/optimization

comment:3 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:4 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:5 by Tim Graham, 12 years ago

Resolution: wontfix
Status: newclosed

I think the docs are fairly explicit in usage: "You add inlines to a model by specifying them in a ModelAdmin.inlines". There's no mention of using admin.site.register() so I don't think this is worth it.

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