Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#7973 closed (fixed)

Add 'exclude' option to BaseModelAdmin

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

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 Phalip 16 years ago.
patch + doc + tests

Download all attachments as: .zip

Change History (9)

comment:1 by Julien Phalip, 16 years ago

milestone: 1.0 beta
Summary: Add 'exclude' attribute to ModelAdminAdd 'exclude' declarative attribute to ModelAdmin

comment:2 by Julien Phalip, 16 years ago

Summary: Add 'exclude' declarative attribute to ModelAdminAdd 'exclude' option to BaseModelAdmin

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

by Julien Phalip, 16 years ago

Attachment: 7973.exclude.diff added

patch + doc + tests

comment:3 by Malcolm Tredinnick, 16 years ago

milestone: 1.0 beta

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

comment:4 by Eric Holscher, 16 years ago

milestone: post-1.0
Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedAccepted

comment:5 by Bob Thomas, 16 years ago

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

Patch already includes tests and docs.

comment:6 by Brian Rosner, 16 years ago

milestone: post-1.01.0

comment:7 by Brian Rosner, 16 years ago

Resolution: fixed
Status: newclosed

(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 by Jacob, 12 years ago

milestone: 1.0

Milestone 1.0 deleted

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