Code

Opened 6 years ago

Closed 6 years ago

#7792 closed (invalid)

Exclude Fields on new-forms admin

Reported by: cschand Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: exclude fields
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Sometimes we need exclude fields on admin (Which have null and blank is True). See ticket(#6755), the Model Inheritance in admin having a field called user_ptr

Here the problem is solved by

Member._meta.get_field('user_ptr').blank = True

But the field still in admin.
So there is a need for exclude fields in admin.Model

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by brosner

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

This is a rare case and will ultimately be fixed when model inheritance is working on the admin. Excluding fields is very simple. Normally you create your own form and use the ModelForm's ability to exclude in the Meta class (this is all documented between admin.txt and newforms.txt in the newforms-admin branch docs). Secondly, perhaps you didn't read the docs well enough to understand that blank will never not show the field. It simply makes it not required. editable would be what you are looking for. This is an invalid report and I am closing.

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.