I have also come across the need for this and would be willing to work on a 
pull request for this feature.

On Wednesday, August 7, 2019 at 3:43:43 AM UTC+2, bjw wrote:
> At present the admin autocomplete docs mention 
> `ModelAdmin.autocomplete_fields` and
> `ModelAdmin.search_fields` which are used to configure select2. There are 
> also options for overriding the queryset used.
> However there seems to be no way of specifyng what is shown in the 
> autocomplete... it just calls `__str__` on the objects returned.
> Would it be possible to add a `search_display_fields` on the relevant 
> ModelAdmin, alongside `search_fields` to customise the display in the form 
> select box? This could be either a model field or a callable on the model 
> or modeladmin.
> Cheers!
> bjw

You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
  • ... bjw
    • ... Janez Kranjc
      • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)

Reply via email to