Re: [Django] #7923: Add links when using raw_id_fields in admin

37 views
Skip to first unread message

Django

unread,
Jan 27, 2016, 6:29:26 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: julianb
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: duplicate
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by hobarrera):

* ui_ux: => 0
* type: => Uncategorized
* severity: => Normal
* easy: => 0


Comment:

Some of the latest patches from #7028 don't include this functionality any
more - aside from the fact that the other issue has stagnated for a year
now.

Can we reopen this, since it's simpler to implement alone? I'd be willing
to work on it myself.

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

Django

unread,
Jan 27, 2016, 6:30:29 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: julianb
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: duplicate
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by hobarrera):

```
Easy pickings unset
Severity set to Normal
Type set to Uncategorized
UI/UX unset
```

Sorry, I didn't touch anything, did I actually do that?

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

Django

unread,
Jan 27, 2016, 6:31:43 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: julianb
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: duplicate
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by hobarrera):

* cc: hugo@… (added)


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

Django

unread,
Jan 27, 2016, 6:41:28 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+------------------------------------
Reporter: julianb | Owner: julianb
Type: New feature | Status: new

Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

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

* status: closed => new
* type: Uncategorized => New feature
* has_patch: 1 => 0
* resolution: duplicate =>


Comment:

Seems fine to me. What about if the user doesn't have the "change"
permission though? In that case we'll be outputting a link that leads to a
"Permission Denied" page. It's not immediately obvious to me if there's a
way to address that.

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

Django

unread,
Jan 27, 2016, 6:56:05 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+------------------------------------
Reporter: julianb | Owner: julianb
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by hobarrera):

We can check if the user has change permissions before rendering the link.

We already do this to show the magnifying glass, I just need to dig into
it a bit. I'll get back on this ASAP.

--
Ticket URL: <https://code.djangoproject.com/ticket/7923#comment:18>

Django

unread,
Jan 27, 2016, 7:56:43 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+------------------------------------
Reporter: julianb | Owner: julianb
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by hobarrera):

> We already do this to show the magnifying glass, I just need to dig


into it a bit. I'll get back on this ASAP.

Scrub that, the magnifying glass to select a related model is also shown
if there are no permissions. There seems to be no clean way of avoiding a
link to a 403 page - but it *is* consistent with the rest of the widget's
behaviour (it's also a bit debatable if it's right to exclude the link or
not).

I'm attaching an updated patch (GitHub is down ATM). It also uses the
current admin site, rather than the default admin instance (which I
noticed right away on my test app which uses several admin instances).

--
Ticket URL: <https://code.djangoproject.com/ticket/7923#comment:19>

Django

unread,
Jan 27, 2016, 7:57:09 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+------------------------------------
Reporter: julianb | Owner: julianb
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by hobarrera):

* Attachment "0001-Add-links-when-using-raw_id_fields-in-admin.patch"
added.

Patch updated to apply on current master

--
Ticket URL: <https://code.djangoproject.com/ticket/7923>

Django

unread,
Jan 27, 2016, 7:58:24 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: hobarrera
Type: New feature | Status: assigned

Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by hobarrera):

* owner: julianb => hobarrera
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/7923#comment:20>

Django

unread,
Jan 27, 2016, 9:57:45 PM1/27/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: hobarrera
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


Comment:

Submitted a PR: https://github.com/django/django/pull/6054

--
Ticket URL: <https://code.djangoproject.com/ticket/7923#comment:21>

Django

unread,
Jan 29, 2016, 9:43:24 AM1/29/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: hobarrera
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


Comment:

Left comments for improvement on the pull request.

--
Ticket URL: <https://code.djangoproject.com/ticket/7923#comment:22>

Django

unread,
Jan 30, 2016, 10:26:18 AM1/30/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: hobarrera
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/7923#comment:23>

Django

unread,
Feb 1, 2016, 7:51:15 AM2/1/16
to django-...@googlegroups.com
#7923: Add links when using raw_id_fields in admin
-------------------------------------+-------------------------------------
Reporter: julianb | Owner: hobarrera
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: admin raw_id_fields | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"8bf8d0e0ecc1805480deb94feb4675b09d3b3a95" 8bf8d0e]:
{{{
#!CommitTicketReference repository=""
revision="8bf8d0e0ecc1805480deb94feb4675b09d3b3a95"
Fixed #7923 -- Added links to objects displayed by
ModelAdmin.raw_id_fields.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/7923#comment:24>

Reply all
Reply to author
Forward
0 new messages