Re: translation Django DB-API into raw SQL

2008-04-10 Thread [EMAIL PROTECTED]
In [19]: def show_sql(query): : clauses = query._get_sql_clause() : return 'SELECT %s %s' % (', '.join(clauses[0]), clauses[1]) : In [21]: show_sql(Page.objects.all()) Out[21]: 'SELECT "main_page"."id", "main_page"."title", "main_page"."slug", "main_page"."content" F

translation Django DB-API into raw SQL

2008-04-10 Thread chups22
I need to translate django db-api query code like modelobject.objects.all() to a raw SQL from a shell, is it possible without using connection.queries (which is logging all SQL - i just need one for a particular line of code) --~--~-~--~~~---~--~~ You received this