Django select objects null or empty

 


Find objects where certain fields are not yet filled in.


from django.db.models import Q

Model.objects.filter(Q(alias__isnull=True) | Q(alias__exact=''))


So common thing that I made a post.
Apparently if you don't know it can take quite a long time to find a solution.

Comments