[Django] #33267: Django Admin: Add Hyperlink to related model

40 views
Skip to first unread message

Django

unread,
Nov 5, 2021, 3:52:16 AM11/5/21
to django-...@googlegroups.com
#33267: Django Admin: Add Hyperlink to related model
------------------------------------------+------------------------
Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
I would like to add a hyperlink next to the select field of a ForeignKey

There is a do-it-yourself way
[https://stackoverflow.com/questions/69566447/django-admin-add-hyperlink-
to-related-model Django Admin: Add Hyperlink to related model], but it
would be nice to have declarative solution.


Would you accept a PR which implements this?

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

Django

unread,
Nov 5, 2021, 3:52:59 AM11/5/21
to django-...@googlegroups.com
#33267: Django Admin: Add Hyperlink to related model
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 3.2
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: 0
--------------------------------+--------------------------------------
Changes (by Thomas Güttler):

* Attachment "django-admin-hyperlink-to-related-model.png" added.

Django

unread,
Nov 5, 2021, 3:53:39 AM11/5/21
to django-...@googlegroups.com
#33267: Django Admin: Add Hyperlink to related model
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 3.2
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: 0
--------------------------------+--------------------------------------
Description changed by Thomas Güttler:

Old description:

> I would like to add a hyperlink next to the select field of a ForeignKey
>
> There is a do-it-yourself way
> [https://stackoverflow.com/questions/69566447/django-admin-add-hyperlink-
> to-related-model Django Admin: Add Hyperlink to related model], but it
> would be nice to have declarative solution.
>

> Would you accept a PR which implements this?

New description:

I would like to add a hyperlink next to the select field of a ForeignKey

There is a do-it-yourself way
[https://stackoverflow.com/questions/69566447/django-admin-add-hyperlink-
to-related-model Django Admin: Add Hyperlink to related model], but it
would be nice to have declarative solution.


Would you accept a PR which implements this?

https://i.stack.imgur.com/X0VrJ.png

--

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

Django

unread,
Nov 5, 2021, 3:54:23 AM11/5/21
to django-...@googlegroups.com
#33267: Django Admin: Add Hyperlink to related model
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 3.2
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: 0
--------------------------------+--------------------------------------
Description changed by Thomas Güttler:

Old description:

> I would like to add a hyperlink next to the select field of a ForeignKey


>
> There is a do-it-yourself way
> [https://stackoverflow.com/questions/69566447/django-admin-add-hyperlink-
> to-related-model Django Admin: Add Hyperlink to related model], but it
> would be nice to have declarative solution.
>

> Would you accept a PR which implements this?
>

> https://i.stack.imgur.com/X0VrJ.png

New description:

I would like to add a hyperlink next to the select field of a ForeignKey

There is a do-it-yourself way
[https://stackoverflow.com/questions/69566447/django-admin-add-hyperlink-
to-related-model Django Admin: Add Hyperlink to related model], but it
would be nice to have declarative solution.

There is an image in the Stackoverflow question which explains it.

Would you accept a PR which implements this?

--

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

Django

unread,
Nov 8, 2021, 5:25:34 AM11/8/21
to django-...@googlegroups.com
#33267: Django Admin: Add Hyperlink to related model
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* component: Uncategorized => contrib.admin


Comment:

Thanks for this ticket. Can you describe your use case? Do you want to
have the same mechanism as the magnifying glass button for
`raw_id_fields`?

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

Django

unread,
Nov 9, 2021, 12:28:37 AM11/9/21
to django-...@googlegroups.com
#33267: Django Admin: Add Hyperlink to related model
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => needsinfo


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

Django

unread,
Nov 9, 2021, 12:29:53 AM11/9/21
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

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

Django

unread,
Nov 19, 2021, 10:13:44 AM11/19/21
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+--------------------------------------
Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+--------------------------------------
Changes (by Thomas Güttler):

* status: closed => new
* resolution: needsinfo =>


Comment:

Sorry for the late reply. The `raw_id_fields` displays a hyperlink next to
the raw-id. That's great. I would like to have exactly the same for non-
raw-id-fields.

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

Django

unread,
Nov 20, 2021, 3:40:36 AM11/20/21
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

Seems similar to b79088306513d5ed76d31ac40ab3c15f858946ea #31181. I think
it's worth having a look at a patch, yes. Thanks Thomas.

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

Django

unread,
Nov 21, 2021, 4:16:01 AM11/21/21
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+------------------------------------
Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+------------------------------------
Changes (by Phil):

* cc: Phil (added)


Comment:

The discussed feature is present in Django==4.1.dev20211119084757
including tests. It is also present in the tag 3.2.9 and 3.2.

For what is the patch then needed? I could do that, but it would be my
first contribution to Django whatsoever.

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

Django

unread,
Jan 1, 2022, 2:03:07 AM1/1/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+----------------------------------------
Reporter: Thomas Güttler | Owner: Shubh Parmar
Type: New feature | Status: assigned

Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+----------------------------------------
Changes (by Shubh Parmar):

* owner: nobody => Shubh Parmar
* status: new => assigned


Comment:

I will try to make a patch for this.

--
Ticket URL: <https://code.djangoproject.com/ticket/33267#comment:9>

Django

unread,
Jan 3, 2022, 12:19:57 AM1/3/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+----------------------------------------
Reporter: Thomas Güttler | Owner: Shubh Parmar
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+----------------------------------------

Comment (by Shubh Parmar):

Do I have to provide a hyperlink to the related object's change page or to
the related model's changelist page?

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

Django

unread,
Jan 11, 2022, 4:47:25 AM1/11/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+----------------------------------------
Reporter: Thomas Güttler | Owner: Shubh Parmar
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+----------------------------------------

Comment (by Shubh Parmar):

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

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

Django

unread,
Jan 11, 2022, 11:23:03 AM1/11/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+----------------------------------------
Reporter: Thomas Güttler | Owner: Shubh Parmar
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+----------------------------------------
Changes (by Jacob Walls):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33267#comment:12>

Django

unread,
Jan 12, 2022, 6:08:56 AM1/12/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+----------------------------------------
Reporter: Thomas Güttler | Owner: Shubh Parmar
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------+----------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33267#comment:13>

Django

unread,
Feb 16, 2022, 12:44:34 PM2/16/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+----------------------------------------
Reporter: Thomas Güttler | Owner: Shubh Parmar
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+----------------------------------------
Changes (by Shubh Parmar):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* needs_docs: 1 => 0


Comment:

I have made the required changes. Can someone review the PR?

--
Ticket URL: <https://code.djangoproject.com/ticket/33267#comment:14>

Django

unread,
Feb 24, 2022, 6:36:20 AM2/24/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
--------------------------------+----------------------------------------
Reporter: Thomas Güttler | Owner: Shubh Parmar
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.2
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: 0
--------------------------------+----------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33267#comment:15>

Django

unread,
Feb 25, 2022, 12:37:25 AM2/25/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
-------------------------------------+-------------------------------------

Reporter: Thomas Güttler | Owner: Shubh
| Parmar
Type: New feature | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33267#comment:16>

Django

unread,
Feb 25, 2022, 1:49:50 AM2/25/22
to django-...@googlegroups.com
#33267: Add Hyperlink to related model in admin change form.
-------------------------------------+-------------------------------------
Reporter: Thomas Güttler | Owner: Shubh
| Parmar
Type: New feature | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

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


Comment:

In [changeset:"11cc227344de06ffd0ad7f07c4e4bdd18851adac" 11cc2273]:
{{{
#!CommitTicketReference repository=""
revision="11cc227344de06ffd0ad7f07c4e4bdd18851adac"
Fixed #33267 -- Added link to related item to related widget wrapper in
admin.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33267#comment:17>

Reply all
Reply to author
Forward
0 new messages