ImageField is a string in the lookup api
|Reported by:||r.pelizzi@…||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.0|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I was trying to retrieve objects which didn't have the image attribute (an ImageField) set yet, so i tried with MyModel.objects.filter(image=None). It didn't match any entry... image__isnull didn't work as well. Then i found out that I had to do MyModel.objects.filter(image=""). So basically it seems that the ImageField is exposed as a string, as far as the lookup api is concerned. (I'm not familiar with django enough to look into django's source code to confirm this). It doesn't seem like a consistent behaviour to me, since the imagefields are high-level objects when accessed from instances.