In Django 1.1 I was able to produce the SQL used by a QuerySet with this notation:
QuerySet
QuerySet.query.as_sql()
In Django 1.2, this
as answered in In django 1.2.1 how can I get something like the old .as_sql?
it's just:
print QuerySet.query