import json
from django.core.serializers.json import DjangoJSONEncoder
prices = Price.objects.filter(product=product).values_list('price',
    'valid_from')
prices_json = json.dumps(list(prices), cls=DjangoJSONEncoder)
Passing objects from Django to Javascript DOM