[Answered ]-How to return default value if field is NULL?

2👍

You can use extra queryset method:

MyModel.objects.extra(select={'field': "coalesce(field, 'Empty')"})

COALESCE should work similarly in most db engines.

Leave a comment