Well, I'm not going to try to figure out why it appears to work for you, but I can't help but notice that the ORM wouldn't know which field to order by given a direct order to order by client
.
It's probably just sorting by PK.
entities = Entity.objects.all().order_by('client__name')
# ^^^^^^ specify sort field
# I am addicted to carets