I'm happy with the instruction to do sorting:
sorted(qs, key=lambda obj: obj.name.lower(), reverse=True)
But as I need to sort the queryset by obj's foreign key's field. It looks invalid with: (Sort won't work! The order didn't change.)
sorted(qs, key=lambda obj: obj.fkname.name.lower(), reverse=True)
which fkname is the foreign key of the object. I don't want to do sorting like this:
Course.objects.order_by("subject__name")[0].name # The course cls has a FK to Subject.
Can this be possible?