Code

Opened 12 months ago

Closed 12 months ago

Last modified 12 months 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 12 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 months 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 12 months 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 12 months 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 12 months ago by timo

comment:4 Changed 12 months 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 12 months 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 12 months 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 12 months 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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.