I have a model like this:
class my_model(models.Model)
foo = models.ManyToManyField(My_other_model)
I want to get all Objects of my_model sorted by the number of objects in the foo field.
In this Question A friendly Guy from russia says, that you should use django-annontation.
I tried the following:
my_model.objects.all().order_by("-foo")
and it works fine. Is there any reason I should go the longer way with annotations?? Thx for help and stay healthy!