Jason Leveille's Blog
Web Development Intoxication
Now Viewing
Mon, 25 Jan 2010 18:50:43 +0000 No Comments
I've had to look for this a few times in the past few days, so I figured I should post it here.
from django.db import DEFAULT_DB_ALIAS Foo.objects.all().query.get_compiler(DEFAULT_DB_ALIAS).as_sql()
or
Foo.objects.all().query.get_compiler('default').as_sql()
Comments have been disabled for this post.