Django

Code

Ticket #7973 (closed: fixed)

Opened 4 months ago

Last modified 3 months ago

Add 'exclude' option to BaseModelAdmin

Reported by: julien Assigned to: nobody
Milestone: 1.0 Component: django.contrib.admin
Version: SVN Keywords:
Cc: bthomas@ncircle.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

7973.exclude.diff (3.4 kB) - added by julien on 07/27/08 07:47:02.
patch + doc + tests

Change History

07/27/08 04:14:36 changed by julien

  • needs_better_patch changed.
  • needs_docs changed.
  • summary changed from Add 'exclude' attribute to ModelAdmin to Add 'exclude' declarative attribute to ModelAdmin.
  • needs_tests changed.
  • milestone set to 1.0 beta.

07/27/08 04:24:48 changed 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.

07/27/08 07:47:02 changed by julien

  • attachment 7973.exclude.diff added.

patch + doc + tests

07/27/08 17:36:52 changed by mtredinnick

  • milestone deleted.

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

08/08/08 14:42:00 changed by ericholscher

  • needs_docs set to 1.
  • stage changed from Unreviewed to Accepted.
  • needs_tests set to 1.
  • milestone set to post-1.0.

08/14/08 09:01:18 changed by bthomas

  • cc set to bthomas@ncircle.com.
  • needs_docs deleted.
  • needs_tests deleted.

Patch already includes tests and docs.

09/02/08 12:25:00 changed by brosner

  • milestone changed from post-1.0 to 1.0.

09/02/08 12:26:24 changed by brosner

  • status changed from new to closed.
  • resolution set to fixed.

(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.


Add/Change #7973 (Add 'exclude' option to BaseModelAdmin)




Change Properties
Action