Possible Duplicate:
Python JSON serialize a Decimal object
I have the following SQL:
SELECT
concat(UNIX_TIMESTAMP(date), '000') as datetime,
SUM(royalty_price) as sales
FROM
sales_raw
GROUP BY
datetime
The results look something like:
datetime sales
1337151600000 1045.71 (decimal)
1337238000000 478.04
1337324400000 300.96
1337410800000 289.02
From this I get the following error:
Exception Type: TypeError at /ajax/graph/
Exception Value: Decimal('1045.71') is not JSON serializable
How would I convert the decimal into an acceptable format in mysql to be able to serialize this data?