#29138: Add ModelAdmin.autocomplete_fields support for ForeignKeys that use to_field -------------------------------+------------------------------------ Reporter: Jonathan Nye | Owner: (none) Type: Bug | Status: new Component: contrib.admin | Version: 2.0 Severity: Normal | Resolution: Keywords: autocomplete | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+------------------------------------ Changes (by Johannes Hoppe):
* owner: Basu Dubey => (none) * status: assigned => new Comment: Replying to [comment:9 Constantino Schillebeeckx]: > I've put together a [https://github.com/ConstantinoSchillebeeckx/django/tree/fix-29138 bug fix] for this. > > '''Note''' I've been able to update all unit tests and create some new ones, however I haven't been able to leverage `to_field_allowed` to prevent data leaks. I've tried to implement it (see [https://github.com/ConstantinoSchillebeeckx/django/blob/fix-29138/django/contrib/admin/views/autocomplete.py#L29 here]), however I can't get it to play nicely with the unit tests. When uncommented, the `id_field` isn't properly being considered as to_field_allowed. I'm not familiar with this function, so could use some help troubleshooting. Hey there! Thanks for the work. It is a little hard to review since you only posted a branch and I don't know what commits to review. Could you maybe assign yourself and open up a pull-request to the Django repo? I will gladly do the first review. Best -Joe -- Ticket URL: <https://code.djangoproject.com/ticket/29138#comment:10> 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/064.dc03e296dcefbf046f65436dc4c33a4b%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.