Re: viewing generated SQL without running the query

2012-02-23 Thread larry.mart...@gmail.com
On Feb 21, 7:32 pm, diafygi wrote: > There's a previous thread about this[1], but it was closed back in > 2006 without resolution. So I'd like to check back in and see if there > is a way to get a complete query string without executing the query. > > At first, I thought I could just use the Query

Re: viewing generated SQL without running the query

2012-02-23 Thread Kelly Nicholes
Can't you get a queryset, like print MyObject.objects.all().query ? On Feb 21, 7:32 pm, diafygi wrote: > There's a previous thread about this[1], but it was closed back in > 2006 without resolution. So I'd like to check back in and see if there > is a way to get a complete query string without e

Re: viewing generated SQL without running the query

2006-08-29 Thread Gary Wilson
Malcolm Tredinnick wrote: > On Tue, 2006-08-29 at 03:53 +, Gary Wilson wrote: > > I see that there is a _get_sql_clause() method, but is there a function > > that will return the constructed query string? > > Deja vu. I tried to implement something like this a little while back. > The thing th

Re: viewing generated SQL without running the query

2006-08-29 Thread Malcolm Tredinnick
On Tue, 2006-08-29 at 03:53 +, Gary Wilson wrote: > I see that there is a _get_sql_clause() method, but is there a function > that will return the constructed query string? Deja vu. I tried to implement something like this a little while back. The thing that is hard about getting it to work i

Re: viewing generated SQL without running the query

2006-08-29 Thread DavidA
Gary Wilson wrote: > I see that there is a _get_sql_clause() method, but is there a function > that will return the constructed query string? You can just do the same construction that's done in django/db/models/query.py: >>> from danet.blog.models import Post, Tag >>> qs = Tag.objects.filter(t