Re: IN clause in raw sql

2010-12-08 Thread David De La Harpe Golden
On 08/12/10 17:42, dgmyrs wrote: > That's a simplified sql just as an example. The actual one I need the > in clause is a lot more complex and can't be handled in the ORM. > [Are you _sure_? name__in=... is so much handier, django sorts it out for you...] Anyway, see also http://code.djangoproj

Re: IN clause in raw sql

2010-12-08 Thread dgmyrs
That's a simplified sql just as an example. The actual one I need the in clause is a lot more complex and can't be handled in the ORM. On Dec 8, 11:40 am, Tom Evans wrote: > On Wed, Dec 8, 2010 at 5:21 PM, dgmyrs wrote: > > Hi, I am trying to work with an in clause in my sql in a raw sql > > s

Re: IN clause in raw sql

2010-12-08 Thread Tom Evans
On Wed, Dec 8, 2010 at 5:21 PM, dgmyrs wrote: > Hi, I am trying to work with an in clause in my sql in a raw sql > statement.  A simplified example: > > Category.objects.raw('select * from app_category where name in(\'Restaurants\',\'Fast Food\')')[0] > > > > So that works fine with th

IN clause in raw sql

2010-12-08 Thread dgmyrs
Hi, I am trying to work with an in clause in my sql in a raw sql statement. A simplified example: >>>Category.objects.raw('select * from app_category where name >>>in(\'Restaurants\',\'Fast Food\')')[0] So that works fine with the in clause hard coded in there, and I could simply build that