Opened 5 years ago
Closed 4 years ago
#31181 closed New feature (fixed)
Admin: Render foreign key models as links for readonly users
Reported by: | Julien Rebetez | Owned by: | Julien Rebetez |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Jeongsoo, Park | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
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: https://groups.google.com/forum/#!topic/django-developers/XFoaohDpqZE
Change History (11)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 3.0 → master |
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 by , 5 years ago
Thanks! Here is the PR : https://github.com/django/django/pull/12343
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 by , 5 years ago
Has patch: | set |
---|
comment:7 by , 4 years ago
Cc: | added |
---|
comment:8 by , 4 years ago
Patch needs improvement: | unset |
---|
comment:9 by , 4 years ago
Needs documentation: | set |
---|---|
Patch needs improvement: | set |
comment:10 by , 4 years ago
Needs documentation: | unset |
---|---|
Patch needs improvement: | unset |
I've updated the PR to address the reviewer's comments. I've also added a small release note line.
I have a WIP patch on github: https://github.com/julienr/django/tree/admin-readonly-remote-fields-links