[Django]-Using absolute function in Django query set order by clause 18 December 2023 by thecoderscamp.com 7👍 q = question.object.filter(type=1).extra( select={"diff": "abs(difficulty-10)"}).order_by("diff") 👤mVChr [Django]-Loop over parent ForeignKey Source:stackexchange.com