[Django] #36881: Documented list of support fields for ModelAdmin.search_fields is inaccurate

1 view
Skip to first unread message

Django

unread,
Jan 23, 2026, 7:52:29 PM (17 hours ago) Jan 23
to django-...@googlegroups.com
#36881: Documented list of support fields for ModelAdmin.search_fields is
inaccurate
----------------------------+-----------------------------------------
Reporter: Tim Graham | Type: Bug
Status: new | Component: Documentation
Version: dev | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+-----------------------------------------
Since Django 1.0, the documentation for `ModelAdmin.search_fields` has
said, "These fields should be some kind of text field, such as CharField
or TextField.", however, this isn't the extent of what's supported. For
example, in the test in 76ccce64cc3d66cfec075651c3d2239fda747dc2 uses
`search_fields = ['child__name', 'child__age']` (the latter is an
`IntegerField`) and 6bc4ff36db0d85ac96ca91ae758159ee43836f86 tests
`search_fields = ['group__pk']`. That said, there may be performance
issues with non-integer fields, see ticket:26001#comment:24, so it may be
prudent to try to address that first, or at least document the caveats of
using non-string fields.
--
Ticket URL: <https://code.djangoproject.com/ticket/36881>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 23, 2026, 8:19:09 PM (17 hours ago) Jan 23
to django-...@googlegroups.com
#36881: Documented list of support fields for ModelAdmin.search_fields is
inaccurate
-------------------------------+--------------------------------------
Reporter: Tim Graham | Owner: (none)
Type: Bug | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Simon Charette):

As extra point of reference #36865 is the ticket avoiding adding
unnecessary cast for `__exact` lookups against non-textual fields.
--
Ticket URL: <https://code.djangoproject.com/ticket/36881#comment:1>

Django

unread,
Jan 23, 2026, 9:24:48 PM (16 hours ago) Jan 23
to django-...@googlegroups.com
#36881: Documented list of support fields for ModelAdmin.search_fields is
inaccurate
-------------------------------+--------------------------------------
Reporter: Tim Graham | Owner: Amar
Type: Bug | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Amar):

* owner: (none) => Amar
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36881#comment:2>
Reply all
Reply to author
Forward
0 new messages