In Django 1.1 I was able to produce the SQL used by a QuerySet with this notation:
QuerySet.query.as_sql()
In Django 1.2, this raises as AttributeError.
Anyone know the Django 1.2 equivalent of that method?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Django 1.1,
QuerySet.queryreturned aBaseQueryobject, now it returns aQueryobjects. The query object has a__str__method defined that returns the SQL.