[Fixed]-Nested serializer ordering when there is no object

1👍

Best bet is to use annotate() as described in this SO question: Django : Order by position ignoring NULL

items = Item.objects.all().annotate(null_position=Count('position')).order_by('-null_position', 'position')

Leave a comment