Re: MySQL Django Wildcard bug...

2006-09-08 Thread Tom Smith
On 8 Sep 2006, at 22:53, James Bennett wrote: > > On 9/8/06, tom smith <[EMAIL PROTECTED]> wrote: >> Then because the sql has a % in it.. django complains... > > The '%' needs to be escaped, because it's a special character in this > context. Make it '%%' (two percent signs in a row) and it

Re: MySQL Django Wildcard bug...

2006-09-08 Thread Steven Armstrong
On 09/08/06 22:56, tom smith wrote: > So... > > Because there aren't quite enough examples that show how to build > pythonic model queries... I'm using the pump-raw-sql at django... > > The only problem is that when my sql contains > > wordsql = wordsql + " AND (title not like ' %" + word

Re: MySQL Django Wildcard bug...

2006-09-08 Thread James Bennett
On 9/8/06, tom smith <[EMAIL PROTECTED]> wrote: > Then because the sql has a % in it.. django complains... The '%' needs to be escaped, because it's a special character in this context. Make it '%%' (two percent signs in a row) and it should work (and this isn't Django-specific AFAIK -- the

MySQL Django Wildcard bug...

2006-09-08 Thread tom smith
So... Because there aren't quite enough examples that show how to build pythonic model queries... I'm using the pump-raw-sql at django... The only problem is that when my sql contains wordsql = wordsql + " AND (title not like ' %" + word +"%') " cursor.execute(sql) Then because the sql has a