[Django]-Is it possible to order_by with a callable?

5👍

It turns out the Annotate method was the solution:

Post.objects.all().annotate(vote_tally=Sum('vote__value')).order_by('-vote_tally')
👤Soviut

Leave a comment