Code

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#7923 closed (duplicate)

Add links when using raw_id_fields in admin

Reported by: julianb Owned by: julianb
Component: contrib.admin Version: master
Severity: Keywords: admin raw_id_fields
Cc: bthomas@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When using raw_id_fields in the admin application you get a field with the id and a link for looking up an id.

Already 'selected' objects are written next to the field for your information, but are not linked.

The patch improves that. You can browse through the objects now.

Attachments (5)

admin-rawid-link.diff (788 bytes) - added by julianb 6 years ago.
patchtest.diff (1.3 KB) - added by julianb 6 years ago.
ticket7923.patch (2.4 KB) - added by mrts 5 years ago.
Patch with test.
ticket7923-2.patch (4.4 KB) - added by mrts 5 years ago.
Fix more tests.
ticket7923-3.patch (4.5 KB) - added by mrts 5 years ago.
Fix a copy-paste from test output that hardcoded admin media prefix.

Download all attachments as: .zip

Change History (18)

Changed 6 years ago by julianb

comment:1 Changed 6 years ago by brosner

  • milestone 1.0 beta deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by ericholscher

  • milestone set to post-1.0
  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 6 years ago by bthomas

  • Cc bthomas@… added

Changed 6 years ago by julianb

comment:4 Changed 6 years ago by adrian

Are the linked objects guaranteed to have an admin page? Looks like this patch assumes that they have one.

comment:5 Changed 6 years ago by julianb

  • Status changed from new to assigned

I think I followed the behavior of the magnifying glass. That is always there and results in a 404 if the object does not have an admin page. This should then be fixed, too.

comment:6 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:7 Changed 5 years ago by guettli

  • Cc hv@… added

comment:8 Changed 5 years ago by mrts

I've updated the code to recent trunk at http://github.com/mrts/django/tree/ticket7923 . One thing that needs to be resolved is whether the link should open in a pop-up. I personally prefer the current behaviour, but a pop-up would be more consistent with how the magnifying glass and + works.

Changed 5 years ago by mrts

Patch with test.

comment:9 Changed 5 years ago by russellm

  • milestone set to 1.2
  • Triage Stage changed from Design decision needed to Accepted

Changed 5 years ago by mrts

Fix more tests.

Changed 5 years ago by mrts

Fix a copy-paste from test output that hardcoded admin media prefix.

comment:10 Changed 5 years ago by mrts

The patch has been merged into the patch attached to #7028 as both issues are tightly related. Will not update the patch here any more.

comment:11 Changed 5 years ago by guettli

  • Cc hv@… removed
  • Resolution set to duplicate
  • Status changed from assigned to closed

See #7028

comment:12 Changed 4 years ago by EmilStenstrom

Here's a snippet that adds links to ManyToManyField too: http://djangosnippets.org/snippets/2217/

comment:13 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.