#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.

-- 
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/0107018e1e54e29a-26a0abdc-5650-4060-8c68-b7c54090cee0-000000%40eu-central-1.amazonses.com.

Reply via email to