0

I have a feeling this is something to do with the answer, but I'm wondering how get a queryset that contains null imagefields?

Doing something like:

 Model.objects.filter(model_image__isnull=True)

Doesn't return anything.

Community
  • 1
  • 1
mrmagooey
  • 4,832
  • 7
  • 37
  • 49

1 Answers1

2

In postgresql when there is no image field looks like '', so I use

Model.objects.filter(model_image='')
szaman
  • 6,666
  • 13
  • 53
  • 81