Skip to content

Instantly share code, notes, and snippets.

View druska's full-sized avatar
🎯
Focusing

Dave Druska druska

🎯
Focusing
View GitHub Profile
@rouge8
rouge8 / fields.py
Created April 23, 2013 16:28
Django REST Framework JSON Field
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)