Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert model object to json django

from django.core import serializers

# assuming obj is a model instance
serialized_obj = serializers.serialize('json', [ obj, ])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #model #object #json #django
ADD COMMENT
Topic
Name
3+1 =