Reputation: 12217
I have the following class:
class Book(models.Model):
picture = models.ImageField(upload_to='books/', blank=True, null=True)
...
I now want to filter the books without a picture. I tried the following:
Book.objects.filter(picture__isnull=True)
The problem is, that the picture is an empty varchar ('') in the db and not null. What to do?
Upvotes: 20
Views: 6187