Re: Display labels for autocomplete fields

2019-08-11 Thread bjw
Actually, I can think of occasions where what is displayed would vary depending on which model the FK was from, not only on the model that is the target. bjw -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)"

Re: Display labels for autocomplete fields

2019-08-11 Thread Janez Kranjc
You don't need one for each field. You need one per model - similar to __str__ On Sunday, August 11, 2019 at 3:54:03 PM UTC+2, 1337 Shadow Hacker wrote: > > > Would it be possible to add a `search_display_fields` on the relevant >> ModelAdmin, alongside `search_fields` to customise the display

Re: Display labels for autocomplete fields

2019-08-11 Thread '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
>> 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. Another suggestion is to add

Re: Display labels for autocomplete fields

2019-08-08 Thread Janez Kranjc
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

Display labels for autocomplete fields

2019-08-06 Thread bjw
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