[Answered ]-Annotation not displaying/working properly


Try doing this instead:

most_injured = Player.objects.annotate(injury_count=Count('playerinjury')).order_by('-injury_count')[:5]


You are querying individual PlayerInjury objects, so of course you have multiple players in your results.

If you Count by id, you will always get a count of one since there is only 1 object per id.

If you want player objects ordered by injuries, you need


Leave a comment