#34339: Enhancement: easier search field customization -----------------------------------------+------------------------------ Reporter: Ramez Issac | Owner: nobody Type: Uncategorized | Status: new Component: contrib.admin | Version: 4.1 Severity: Normal | Keywords: admin search Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 1 UI/UX: 0 | -----------------------------------------+------------------------------ In ModelAdmin, `get_search_result` uses an ''inner'' function `construct_search` to add the __icontains , istartswith, iexact
It can be much easier for more customization, if construct_search function was override-able. FYI, My Case is: i can not add a related id field to search_fields... have to use traversing . {{{ class MyAdmin(admin.ModelAdmin): search_fields = ['client_id', # wont work 'client__id' # will work ] }}} -- Ticket URL: <https://code.djangoproject.com/ticket/34339> 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/01070186551698c9-ecea9086-db65-4c15-8763-37d2f611993f-000000%40eu-central-1.amazonses.com.