﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30074	Cannot Un-escape LIKE wildcards without .extra()	Doug Dresser	nobody	"Currently, django escapes wildcards used in SQL LIKE clauses. See here https://docs.djangoproject.com/en/dev/topics/db/queries/#escaping-percent-signs-and-underscores-in-like-statements. 

At times, I have found it desirable to actually want wildcards, and there are only two options to replicate this to my knowledge:

1) Raw SQL using .extra()
2) Using a regular expression such as .filter(somefield!__regex=<regex_lookup>)

The first option is undesirable because its using raw sql, not high level python. The second is undesirable because SQL REGEX is much much slower than using a LIKE clause with wildcards.

I propose adding an optional parameter (thus allowing backwards compatibility) within .filter(), such as .filter(somefield!__contains=FO%BAR, escape=False) which will allow the filter expression to not escape the underscores and percentage signs."	New feature	closed	Database layer (models, ORM)	2.1	Normal	invalid	QuerySet.extra		Unreviewed	0	0	0	0	0	0
