According to the docs, when using 'contains' in filter() a percent sign
or underscore is automatically escaped.  However, in my case I want the
resulting SQL to use the percent sign.

I know 'contains' will fill in the outside percent signs, but it escapes
the percent sign in my string.  So that calling:

        Entry.objects.filter(headline__contains='a%b')

will result in:

        SELECT ... WHERE headline LIKE '%a\%b%';

but I want it to be this instead:

        SELECT ... WHERE headline LIKE '%a%b%';

This there an easy way to do this?

I could use regexp, but I didn't want people to know that they would
have to use "a.*b" instead of "a*b", just trying to make it simplier for
myself and the people using the system.
-- 
Adam Stein @ Xerox Corporation       Email: a...@eng.mc.xerox.com

Disclaimer: Any/All views expressed
here have been proven to be my own.  [http://www.csh.rit.edu/~adam/]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to