#13165: Display edit link beside add button for ForeignKey fields in admin
-------------------------------------+-------------------------------------
     Reporter:  DrMeers              |                    Owner:  charettes
         Type:  New feature          |                   Status:  assigned
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  admin foreign key    |             Triage Stage:  Accepted
  edit link                          |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  1
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by charettes):

 I've been working on this lately and
 [https://github.com/charettes/django/compare/ticket-13165-edit-and-delete-
 links almost everything is working correctly].

 The last missing part concerns foreign keys with `to_field` since there's
 no way to retrieve the related object based on the selected `to_field`
 value.

 We've got two options here:

 1. Provides views redirecting to the related object change and delete
 views based on the provided `to_field` value;
 2. Attach a `data-pk` attribute on all options (in the case of `Select`
 widget) or to the raw id input to retrieve.

 The second option doesn't seems viable since it's requires a lot of
 special casing when dealing with different types of widgets.

 The first one should be doable by allowing `ModelAdmin.get_object` to
 receive a third parameter specifying which field to retrieve it's model
 from.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3c40beb1b4e98724d218d71c71146303%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to