Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#21908 closed Cleanup/optimization (fixed)

Misleading documentation in ModelAdmin.get_inline_instances

Reported by: matt@… Owned by: avendael
Component: Documentation Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The documentation for this method seems a little sparse:

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_inline_instances

It's not actually clear that you need to instantiate the inline classes in this manner:

return [inline(self.model, self.admin_site) for inline in self.inlines]

(Obviously, that is without filtering).

I'm happy to submit a documentation patch, if it is likely to be accepted.

Attachments (1)

patch.diff (706 bytes ) - added by avendael 10 years ago.
Added description of how to instantiate inline instances

Download all attachments as: .zip

Change History (8)

comment:1 by Tim Graham, 10 years ago

Component: contrib.adminDocumentation
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Sure, I'll be happy to review your patch.

comment:2 by avendael, 10 years ago

Owner: changed from nobody to avendael
Status: newassigned

by avendael, 10 years ago

Attachment: patch.diff added

Added description of how to instantiate inline instances

comment:3 by avendael, 10 years ago

I'm not sure if my patch is good enough. It's my first time to contribute to django :)

comment:4 by alextreme, 10 years ago

Your patch is close, however fyi it uses a single colon where a double-colon should be used. A double colon indicates that the next block is a code sample.

comment:5 by Tim Graham, 10 years ago

Has patch: set

comment:6 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 5a4f1298cf00fe4e2e35d0a3c02281b4c6afe07c:

Fixed #21908 -- Added example usage for ModelAdmin.get_inline_instances().

Thanks matt at schinckel.net for the suggestion.

comment:7 by Tim Graham <timograham@…>, 10 years ago

In e7649789eddeb2ce8f3bf8f69ddc624006d0a46c:

[1.6.x] Fixed #21908 -- Added example usage for ModelAdmin.get_inline_instances().

Thanks matt at schinckel.net for the suggestion.

Backport of 5a4f1298cf from master

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