Code

Opened 8 years ago

Closed 7 years ago

#2328 closed defect (wontfix)

[patch] admin does not allow omitting fields in Admin.fields list

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

Description

I ran into this trying to do something in similar vein to Luke Holt's fields-varying-with-user
hack.

The admin app assumes that all of the model's fields are present on the edit page, so
if you don't put a field somewhere in Model.Admin.fields then Django will try to set it
to null every time you try to modify an instance through the admin interface. I fixed this
by changing admin's change_stage function to create follow parameter for the ChangeManipulator
using values from Model.Admin.fields lists.

Not fully tested yet, I'm putting the patch here hoping that someone will let me know if this
is a bad idea.

Attachments (1)

diff_follow_in_admin.txt (782 bytes) - added by marcink@… 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by marcink@…

comment:1 Changed 8 years ago by anonymous

  • Cc marcink@… added

comment:2 Changed 7 years ago by Simon G. <dev@…>

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

Thanks for the patch marcink, but I'm marking this as wontfix - the newforms admin should fix this.

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.