[Django] #31181: Admin: Render foreign key models as links for readonly users

50 views
Skip to first unread message

Django

unread,
Jan 18, 2020, 2:06:39 PM1/18/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
-----------------------------------------+--------------------------
Reporter: julienr | Owner: julienr
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-----------------------------------------+--------------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/31181>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 18, 2020, 2:12:13 PM1/18/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
-------------------------------+--------------------------------------

Reporter: julienr | Owner: julienr
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------

Comment (by julienr):

I have a WIP patch on github: https://github.com/julienr/django/tree
/admin-readonly-remote-fields-links

--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:1>

Django

unread,
Jan 21, 2020, 9:54:12 AM1/21/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez

Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------
Changes (by Carlton Gibson):

* version: 3.0 => master
* stage: Unreviewed => Accepted


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:2>

Django

unread,
Jan 21, 2020, 4:07:22 PM1/21/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------

Comment (by Julien Rebetez):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:3>

Django

unread,
Jan 22, 2020, 2:34:38 AM1/22/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------
Changes (by Claude Paroz):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:4>

Django

unread,
Feb 5, 2020, 5:41:31 AM2/5/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/12343 PR]

We should skip m2m fields in this change.

--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:5>

Django

unread,
Feb 11, 2020, 3:37:03 PM2/11/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------

Comment (by Julien Rebetez):

I've amended the github PR to not include m2m

--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:6>

Django

unread,
Jun 29, 2020, 12:01:02 PM6/29/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------
Changes (by Jeongsoo, Park):

* cc: Jeongsoo, Park (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:7>

Django

unread,
Oct 2, 2020, 2:56:26 AM10/2/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------
Changes (by felixxm):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:8>

Django

unread,
Oct 7, 2020, 3:27:19 PM10/7/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------
Changes (by Julien Rebetez):

* needs_better_patch: 1 => 0

* needs_docs: 1 => 0


Comment:

I've updated the [https://github.com/django/django/pull/12343 PR] to
address the reviewer's comments. I've also added a small release note
line.

--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:10>

Django

unread,
Oct 8, 2020, 2:22:52 PM10/8/20
to django-...@googlegroups.com
#31181: Admin: Render foreign key models as links for readonly users
--------------------------------+------------------------------------------
Reporter: Julien Rebetez | Owner: Julien Rebetez
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+------------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b79088306513d5ed76d31ac40ab3c15f858946ea" b7908830]:
{{{
#!CommitTicketReference repository=""
revision="b79088306513d5ed76d31ac40ab3c15f858946ea"
Fixed #31181 -- Added links to related models for admin's readonly fields.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31181#comment:11>

Reply all
Reply to author
Forward
0 new messages