#27429: had to use QuerySet.extra to do WHERE LIKE with arbitrary amount /
placement of wildcard characters
---------------------------------+--------------------------------------
     Reporter:  Lance Robertson  |                    Owner:  nobody
         Type:  Uncategorized    |                   Status:  new
    Component:  Uncategorized    |                  Version:  1.10
     Severity:  Normal           |               Resolution:
     Keywords:  QuerySet.extra   |             Triage Stage:  Unreviewed
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------
Description changed by Lance Robertson:

Old description:

> My use case is that I'm trying to find phonetic patterns that rhyme using
> a database I built from the pronunciation dictionary CMUdict
>
> For example:
>  {{{#!python
> Pronunciation.objects.extra(where=["code LIKE '%% - %%__1 - S T __0 D'"])
>   }}}
> I want to be able to filter with % and _ wildcards in arbitrary amounts
> and places in the search string beyond just __contains, __startswith, and
> __endswith, and the only way I could figure out how to do it is either to
> use a raw query or .extra - if .extra goes away I hope filter will
> support this behavior!

New description:

 My use case is that I'm trying to find phonetic patterns that rhyme using
 a database I built from the pronunciation dictionary CMUdict

 For example:
  {{{#!python
 Pronunciation.objects.extra(where=["code LIKE '%% - %%__1 - S T __0 D'"])
   }}}
 I want to be able to filter with % and _ wildcards in arbitrary amounts
 and places in the search string beyond just contains, startswith, and
 endswith, and the only way I could figure out how to do it is either to
 use a raw query or .extra - if .extra goes away I hope filter will support
 this behavior!

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27429#comment:1>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.569fc5f46915a3b360d010b2c957f55f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to