Reputation: 27
I ran a raw query just as the Django docs point:
Model.objects.raw('SELECT * FROM model')
and I got this result, Why it only shows the object?
<RawQuerySet: 'SELECT * FROM model'>
Upvotes: 0
Views: 956
Reputation: 3959
Because one (very powerful) feature of a queryset is, that it does not hit the database until necessary. You might slice it to get the results.
Model.objects.raw('SELECT * FROM model')[:]
Read the first paragraph of the queryset docs to learn more about other ways to execute the underlying query.
Upvotes: 1