I have simple model like this:
class Something(models.Model):
data = models.CharField(max_length=200)
And when Im performing this:
Something.objects.all().query
I get this:
<django.db.models.sql.query.Query object at 0xa57b9ec>
What is it mean?
Im using newest version of Django (1.5.2). In older versions .query was returned a string with the SQL query. How can I get it in new version?
As we found out in the comments, that's your answer:
str(Something.objects.all().query)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With