Opened 8 years ago
Last modified 8 years ago
#27429 closed New feature
had to use QuerySet.extra to do WHERE LIKE with arbitrary amount / placement of wildcard characters — at Initial Version
Reported by: | Lance Robertson | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | QuerySet.extra |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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:
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!
Note:
See TracTickets
for help on using tickets.