Blog from the Loft

Thoughts without walls

Blog from the Loft header image 2

Django dumpdata does not work with numeric fields

June 28th, 2007 · No Comments · django

I try to dump my database in Postgres to json so that I can load it into my test system. Executing manage.py dumpdata gives me an error:

Unable to serialize database: Decimal("349.00") is not JSON serializable

Some googling finds ticket number 3324, a problem with the serializer. This is patched in the development tree already. Since I want to keep 0.96 in production, I just hand patched the json serializer source file from the diff, and it works now.

See the diff output here .

Tags: