This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from rest_framework import serializers | |
class JSONField(serializers.WritableField): | |
def to_native(self, obj): | |
return json.dumps(obj) | |
def from_native(self, value): | |
return json.loads(value) |