I have a query set which contains Decimal objects. I want to pass this data to a json dump along the lines:
ql = Product.objects.values_list('length', 'width').get(id=product_id)
data = simplejson.dumps(ql)
TypeError: Decimal('62.20') is not JSON serializable
How should I pass these values to json. Of course I could cast the values to string - but I'm guessing this is not a good solution.
Any help much appreciated.