I have a FileField in a Django Model. Some entries in this FileField are set to <ImageFieldFile: null>
.
The rest of the Model table are blank or actual images. I need to clean this table so that these erroraneous entries are also changed to blank, as this is not acceptable in my DRF API.
Get all the image instance.
objs =myclassmodel.objects.all() //just assuming this
for obj in objs:
obj.image = ""
obj.save()
It will you if understand it right.