Let\'s say I have a queryset of things Bill has worked on like this:
test=Things.objects.filter(user=\'Bill\')
Now I want to sort all those
see these answers to use a computed value to sort a QuerySet:
Basically if thing_date() can be determined using a query expression, then you can use it to annotate and search the query set.
from django.db.models import F
from django.utils import timezone
test = Things.objects.filter(user='Bill').annotate(
thing_date=(F('') - timezone.now()) # some computation
).order_by('thing_date')