Opened 7 months ago

Last modified 6 weeks ago

#31181 assigned New feature

Admin: Render foreign key models as links for readonly users

Reported by: Julien Rebetez Owned by: Julien Rebetez
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Jeongsoo, Park Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: yes


In the admin UI, when viewing a model for which you have view only permission, foreign key / m2m fields are rendered as plaintext representation of the target object.

It would be nicer to render those as links instead so that a readonly user can navigate through the relationships.

The link should only be rendered if the user has permission to view the target model.

django-developers discussion:!topic/django-developers/XFoaohDpqZE

Change History (7)

comment:2 Changed 7 months ago by Carlton Gibson

Triage Stage: UnreviewedAccepted
Version: 3.0master

Hi Julian. Thanks for this. I agree, it does sound like a nice enhancement.

Please open a PR from your branch. Commit message/title Fixed #31181 -- Added links....
If you could post a small screenshot of two, showing the improvement, that makes it easier at first glance too.

comment:3 Changed 7 months ago by Julien Rebetez

Thanks! Here is the PR :

I've added screenshots directly in the PR. There are also some open questions / points to discuss in the description of the PR.

comment:4 Changed 7 months ago by Claude Paroz

Has patch: set

comment:5 Changed 6 months ago by felixxm

Patch needs improvement: set


We should skip m2m fields in this change.

comment:6 Changed 6 months ago by Julien Rebetez

I've amended the github PR to not include m2m

comment:7 Changed 6 weeks ago by Jeongsoo, Park

Cc: Jeongsoo, Park added
Note: See TracTickets for help on using tickets.
Back to Top