I have a model with ImageField type below:
class Attendance(models.Model):
face_image = models.ImageField(, blank=True, null=True, storage=MediaStorage())
A serializer that is based on the model
class AttendanceSerializer(serializers.ModelSerializer):
class Meta:
model = Attendance
fields = ('id','face_image')
However if the imagefield is null, it shows like this
Its now showing like this in the json
{
"id": 1,
"face_image": null
}
It will show an output for face_image (ImageField) as null if it is None. What I would like is to substitute null to be an empty string like this ""