Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20762 closed Cleanup/optimization (fixed)

Clarify that add_fieldsets is not a standard ModelAdmin attribute

Reported by: vim@… Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The ModelAdmin.add_fieldsets attribute is not documented in the reference section for ModelAdmin options (ref/contrib/admin/#modeladmin-options), although it does appear in the example code for using a custom user model (topics/auth/customizing/#a-full-example), at the very end.

This is really useful. I think it should be documented more clearly, where people are likely to look for it.

Attachments (1)

20762.diff (587 bytes) - added by timo 2 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 2 years ago by loic84

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

UserAdmin.add_fieldsets is neither a public API nor a generic mechanism, it's an implementation detail of the UserAdmin class.

It wouldn't work on any other ModelAdmin unless you implement a custom ModelAdmin.get_fieldsets() that takes advantage of it.

comment:2 Changed 2 years ago by timo

I was going to suggest we add a comment to that effect in topics/auth/customizing/#a-full-example

comment:3 Changed 2 years ago by loic84

@timo: it's actually easier to document since we've fixed #18681 because the get_form() override is no longer necessary.

Unless of course you really need a different form, but in that case you can still leave out the flatten_fieldsets() bit.

Changed 2 years ago by timo

comment:4 Changed 2 years ago by timo

  • Resolution invalid deleted
  • Status changed from closed to new
  • Summary changed from ModelAdmin.add_fieldsets missing from reference documentation to Clarify that add_fieldsets is not a standard ModelAdmin attribute
  • Type changed from Bug to Cleanup/optimization

comment:5 Changed 2 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In dce8945ea63c636a71f3bc5d610dccebc08c52eb:

Fixed #20762 -- Clarified that add_fieldsets is not a standard ModelAdmin attribute.

comment:6 Changed 2 years ago by Tim Graham <timograham@…>

In cbfe56c856f9bb79fdd36d7e573c6156bb88720a:

[1.5.x] Fixed #20762 -- Clarified that add_fieldsets is not a standard ModelAdmin attribute.

Backport of dce8945ea6 from master

comment:7 Changed 2 years ago by Tim Graham <timograham@…>

In 579ca9ee8d3c47ba46385db6beb2318cea97b123:

[1.6.x] Fixed #20762 -- Clarified that add_fieldsets is not a standard ModelAdmin attribute.

Backport of dce8945ea6 from master

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