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:2 by Carlton Gibson, 5 years ago

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 by Julien Rebetez, 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 Claude Paroz, 5 years ago

Has patch: set

comment:5 by Mariusz Felisiak, 5 years ago

Patch needs improvement: set

PR

We should skip m2m fields in this change.

comment:6 by Julien Rebetez, 5 years ago

I've amended the github PR to not include m2m

comment:7 by Jeongsoo, Park, 4 years ago

Cc: Jeongsoo, Park added

comment:8 by Mariusz Felisiak, 4 years ago

Patch needs improvement: unset

comment:9 by Mariusz Felisiak, 4 years ago

Needs documentation: set
Patch needs improvement: set

comment:10 by Julien Rebetez, 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.

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In b7908830:

Fixed #31181 -- Added links to related models for admin's readonly fields.

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