[Answered ]-Can't filter empty fields in Django

1👍

I finally got it working this way:

list(App.objects.filter(admins__email__regex='.').values('admins__email'))

although I find it odd that __exact='' is not working. seems like a Django bug to me.

👤Sin

0👍

Try this

User.objects.exclude(email__isnull=True).exclude(email__exact='')

Leave a comment