Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#12654 closed (fixed)

Admin readonly_fields not working with ForeignKey fields

Reported by: Karataev Pavel Owned by: Karataev Pavel
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you add any ForeignKey field to readonly_fields, it will displayed in change_view as number (primary key).

Attachments (2)

fix.diff (450 bytes ) - added by Karataev Pavel 14 years ago.
test.diff (2.8 KB ) - added by Karataev Pavel 14 years ago.
Better tests

Download all attachments as: .zip

Change History (6)

by Karataev Pavel, 14 years ago

Attachment: fix.diff added

comment:1 by Alex Gaynor, 14 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

The fix looks reasonable, can you work up a test case for this?

comment:2 by Karataev Pavel, 14 years ago

Owner: changed from nobody to Karataev Pavel
Status: newassigned

yes, i will write it in regressiontests/admin_util/tests.py

by Karataev Pavel, 14 years ago

Attachment: test.diff added

Better tests

comment:3 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [12366]) Fixed #12654 - Correctly display ForeignKey fields in read-only scenarios. Thanks, minmax.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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