I want to filter out empty value on email column.
So I tried this:
users = User.objects.filter(email__iexact='')
But, record has empty value would not be appeared.
Anyone know why is that?
Model is:
class User(models.Model):
email = models.EmailField(blank=True)
If you want to display all the emails that are not empty (filter-out empty) then you can exclude them using
users = User.objects.exclude(email__isnull=True)
If you want to get all the columns with empty email value then use
users = User.objects.filter(email__isnull=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With