I know that you can get the SQL of a given QuerySet using
print query.query
but as we know from a previous question ( http://stackoverflow.com/questions/2926483/potential-django-bug-in-queryset-query ) the returned SQL is not properly quoted. See http://code.djangoproject.com/browser/django/trunk/django/db/models/sql/query.py
Is there any way that is it possible to get the raw, executable SQL (quoted) for a given QuerySet without actually executing it?