Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#7973 closed (fixed)

Add 'exclude' option to BaseModelAdmin

Reported by: julien Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: bthomas@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

ModelForm features an 'exclude' attribute which is great when you want to exclude only a few fields from the model's form. This has many advantages as it avoids specifying of all the fields that you *do* want to display, and if a field is later added to the model it will automatically be picked up in the form without having to explicitly add it again to the form's field list.

Unfortunately, ModelAdmin doesn't have that. It'd be great to have it, both for consistency and ease of use.

Attachments (1)

7973.exclude.diff (3.4 KB) - added by julien 7 years ago.
patch + doc + tests

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by julien

  • milestone set to 1.0 beta
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Add 'exclude' attribute to ModelAdmin to Add 'exclude' declarative attribute to ModelAdmin

comment:2 Changed 7 years ago by julien

  • Summary changed from Add 'exclude' declarative attribute to ModelAdmin to Add 'exclude' option to BaseModelAdmin

'option' seems to be the correct term for this.

Changed 7 years ago by julien

patch + doc + tests

comment:3 Changed 7 years ago by mtredinnick

  • milestone 1.0 beta deleted

This isn't 1.0-beta material. It could even be done after 1.0, since it should be fully backwards compatible.

comment:4 Changed 7 years ago by ericholscher

  • milestone set to post-1.0
  • Needs documentation set
  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 7 years ago by bthomas

  • Cc bthomas@… added
  • Needs documentation unset
  • Needs tests unset

Patch already includes tests and docs.

comment:6 Changed 7 years ago by brosner

  • milestone changed from post-1.0 to 1.0

comment:7 Changed 7 years ago by brosner

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

(In [8861]) Fixed #7973 -- Added exclude to BaseModelAdmin to make everything consistent with the form/formset factories. Refs #8071 to make it easier to get at exclude. Thanks julien for the patch.

comment:6 Changed 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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