I would like to sort a model by using Postgresql\'s \"NULLS LAST\" option. How could it be done?
I tried something like
MyModel.objects.all().extra(ord
from django.db.models import F
MyModel.objects.all().order_by(F('price').desc(nulls_last=True))
This functionality has been added to Django 1.11.
https://docs.djangoproject.com/en/dev/releases/1.11/
Added the nulls_first and nulls_last parameters to Expression.asc() and desc() to control the ordering of null values.