[Answered ]-Django: Order_by 2 variables and Reverse the order of one of them

2👍

order_by arguments are strings. You can simply prepend a - to reverse the order of one of them:

variable_2 = '-' + variable_2
Some_Model.objects.all().order_by(variable_1, variable_2)

Leave a comment