Re: Possible to see sql for queryset before database gets it?

2009-01-19 Thread phoebebright
Thanks for those tips. Great help. On Jan 19, 12:37 am, Malcolm Tredinnick wrote: > On Sun, 2009-01-18 at 17:46 -0200, Ramiro Morales wrote: > > [] > > > > > or if you are using a recent trunk version (more recent than two weeks or > > so) > > you might want to

Re: Possible to see sql for queryset before database gets it?

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 17:46 -0200, Ramiro Morales wrote: [] > > or if you are using a recent trunk version (more recent than two weeks or so) > you might want to try printing the output of: > > .as_sql() Please don't recommend that one, it's very likely to change in the near future (like,

Re: Possible to see sql for queryset before database gets it?

2009-01-18 Thread Ramiro Morales
On Sun, Jan 18, 2009 at 5:27 PM, phoebebright wrote: > > I have a problem with the sql being generated by this: > >tasks = Task.objects.filter(status='open').order_by('-priority') >tasks = tasks.extra(where=['list IN %s'], params= > [settings.MY_LISTS]) > > Is

Possible to see sql for queryset before database gets it?

2009-01-18 Thread phoebebright
I have a problem with the sql being generated by this: tasks = Task.objects.filter(status='open').order_by('-priority') tasks = tasks.extra(where=['list IN %s'], params= [settings.MY_LISTS]) Is there a command where I can say something like 'print tasks.sql' that would generate the sql