Hi,
I've been struggling to save a null value to a Postgres 9.6 JSON field using DRF. I'm testing with the Browsable API if that makes a difference.
class MyModel(models.Model):
data = JSONField(blank=True, null=True)
class MyModelSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = MyModel
fields = (
'url',
'data',
)
The validator says "Value must be valid JSON." when I leave the value blank.
I've tried every combination of required, allow_null, default that I can think of and nothing works.
Any help?
Thanks,
Jeff