Re: [Django] #34339: Allow overriding construct_search().

13 views
Skip to first unread message

Django

unread,
Mar 8, 2024, 8:51:07 AM3/8/24
to django-...@googlegroups.com
#34339: Allow overriding construct_search().
-------------------------------+--------------------------------------
Reporter: Ramez Issac | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: admin search | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by averta):

Hello,

I would like to use search unaccent sensitive in the admin search.

Ideally, I would be able to override construct_search as :

{{{
def custom_construct_search(field_name):
if field_name.startswith("^"):
return "%s__unaccent__istartswith" % field_name[1:]
elif field_name.startswith("="):
return "%s__unaccent__iexact" % field_name[1:]
elif field_name.startswith("@"):
return "%s__unaccent__search" % field_name[1:]
else:
return "%s__unaccent__icontains" % field_name
}}}

How else would you recommend doing so ?
--
Ticket URL: <https://code.djangoproject.com/ticket/34339#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 8, 2024, 8:52:36 AM3/8/24
to django-...@googlegroups.com
#34339: Allow overriding construct_search().
-------------------------------+--------------------------------------
Reporter: Ramez Issac | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution:
Keywords: admin search | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by averta):

* resolution: wontfix =>
* status: closed => new

--
Ticket URL: <https://code.djangoproject.com/ticket/34339#comment:3>

Django

unread,
Mar 8, 2024, 8:59:46 AM3/8/24
to django-...@googlegroups.com
#34339: Allow overriding construct_search().
-------------------------------+--------------------------------------
Reporter: Ramez Issac | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: admin search | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* resolution: => wontfix
* status: new => closed

Comment:

Hello averta, please do not reopen tickets closed as `wontfix` without
following the proper process
([https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#closing-tickets see details]).

If you need help understanding how Django works or how you can achieve
something specifically, please see TicketClosingReasons/UseSupportChannels
for ways to get help.
--
Ticket URL: <https://code.djangoproject.com/ticket/34339#comment:4>
Reply all
Reply to author
Forward
0 new messages