Django doesn't group by if I omit order_by() clause

I was trying to find an answer for this question in documentation but I unfortunately did not succeed. In documentation it states that if I want to group my objects and Count them I should use the following:


However it doesn't work. But when I add simple order_by it does:


Any idea why is that? They didn't mention that in documentation.

Back to Top