def _flatten_value(self, value):
        if not value:
            return ""

        if isinstance(value, dict):
            value = json.dumps(
                value, use_decimal=True,
                default=json_encode_default)

        assert isinstance(value, six.string_types)

        return value
Return either a string, JSON-encoding dict()s as necessary
dataset/ETHPy150Open matthiask/plata/plata/fields.py/JSONField._flatten_value