[Django] #35423: Show which fields are being searched in Admin change_list's `search_fields`

11 views
Skip to first unread message

Django

unread,
May 2, 2024, 11:20:23 AMMay 2
to django-...@googlegroups.com
#35423: Show which fields are being searched in Admin change_list's `search_fields`
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
RenDelaCruz |
Type: New | Status: new
feature |
Component: | Version: 5.0
contrib.admin | Keywords: admin,
Severity: Normal | search_fields, change_list, search,
Triage Stage: | ui
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 1 |
-------------------------------------+-------------------------------------
In any Django Admin change_list pages, when including a `search_fields`
attribute, the search bar does not indicate which fields are searchable.
This can easily be confused with attributes on the sidebar `list_filter`.

Maybe something like a greyed-out caption indicating the model fields
included in `search_fields`.
--
Ticket URL: <https://code.djangoproject.com/ticket/35423>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 2, 2024, 12:23:47 PMMay 2
to django-...@googlegroups.com
#35423: Show which fields are being searched in Admin change_list's `search_fields`
-------------------------------------+-------------------------------------
Reporter: Ren de la Cruz | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
search_fields, change_list, |
search, ui |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* cc: Thibaud Colas, Tom Carrick, Sarah Abderemane (added)
* stage: Unreviewed => Accepted
* type: New feature => Cleanup/optimization

Comment:

Hello RenDelaCruz, thank you for your interest in making Django better.

I can relate to your report, and I can see value in a small help text
below the search box. I'm tentatively accepting to see how this would look
like in the UI, are you available to propose a PR? We would love to count
on your contribution for this!

We should definitely consider the accessibility aspects of this, but IMHO
as long as the adding is equivalent to form fields help text, this should
comply with all the accessibility requirements.
--
Ticket URL: <https://code.djangoproject.com/ticket/35423#comment:1>

Django

unread,
May 7, 2024, 2:30:34 AMMay 7
to django-...@googlegroups.com
#35423: Show which fields are being searched in Admin change_list's `search_fields`
-------------------------------------+-------------------------------------
Reporter: Ren de la Cruz | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
search_fields, change_list, |
search, ui |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Rajeesh Punathil):

Yes, this can be quickly added as a small help text below and I tried that
but what about values like {{{user__email, name__exact, ^question,
@descr}}}, etc? We may need to use verbose equivalents for each, because
the admin staff may not have technical knowledge to understand them as
they are given. What's the suggestion?
--
Ticket URL: <https://code.djangoproject.com/ticket/35423#comment:2>

Django

unread,
May 10, 2024, 5:43:44 AMMay 10
to django-...@googlegroups.com
#35423: Show which fields are being searched in Admin change_list's `search_fields`
-------------------------------------+-------------------------------------
Reporter: Ren de la Cruz | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
search_fields, change_list, |
search, ui |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Jakub Szafrański):

If we aim for readability, perhaps it would make sense to resolve the
fields and use field labels (if present) and some verbose text explaining
what lookup is used?

Having many `search_fields` and/or fields with various lookups can lead to
a potentially long help text which might hinder readability, so perhaps
using some icons would make sense.

I can have a look at it and experiment with various formats so we can
decide
--
Ticket URL: <https://code.djangoproject.com/ticket/35423#comment:3>

Django

unread,
May 10, 2024, 6:10:26 AMMay 10
to django-...@googlegroups.com
#35423: Show which fields are being searched in Admin change_list's `search_fields`
-------------------------------------+-------------------------------------
Reporter: Ren de la Cruz | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
search_fields, change_list, |
search, ui |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce):

I think it's quite rare to have a help text that goes deep into the
specifics of what is searchable and what isn't.
We don't have an icon on columns when filters are applied, or text
highlighting of searched text we found (which are more common UI
patterns).
I think going into the specifics of search in the user interface is not
worth it. Most people "search" to find out what the search does.
--
Ticket URL: <https://code.djangoproject.com/ticket/35423#comment:4>

Django

unread,
May 10, 2024, 3:32:00 PMMay 10
to django-...@googlegroups.com
#35423: Show which fields are being searched in Admin change_list's `search_fields`
-------------------------------------+-------------------------------------
Reporter: Ren de la Cruz | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: admin, | Triage Stage:
search_fields, change_list, | Unreviewed
search, ui |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* resolution: => invalid
* stage: Accepted => Unreviewed
* status: new => closed

Comment:

I see your point Sarah, thanks for sharing your view on this matter. While
I think it would be a nice addition to have a descriptive help text under
the search field, I agree this may need a wider discussion and a higher
level design that would consider other UI elements.

Closing as `invalid` following the
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#closing-tickets ticket triaging process]. Ren, please consider
starting a new conversation on the
[https://forum.djangoproject.com/c/internals/5 Django Forum], where you'll
reach a wider audience and likely get extra feedback. If there is a
community agreement for this feature request, you are welcome to come back
to the ticket and point to the forum topic, so we can then re-open it.
--
Ticket URL: <https://code.djangoproject.com/ticket/35423#comment:5>
Reply all
Reply to author
Forward
0 new messages