codeforamerica / cfapi

The Code for America API. Tracks and motivates activity and participation across the civic technology movement.
http://codeforamerica.org/api
MIT License
113 stars 52 forks source link

Install simplejson for JSON serialization #320

Closed tdooner closed 6 years ago

tdooner commented 6 years ago

If simplejson is installed, Flask will autodetect it and use it for JSON serialization. This is necessary because the lat/lon are returned from the database as decimal objects, which are not able to be serialized by the stdlib JSON serializer. I guess these are things you learn as you get better at python. If I had to do it over again, I'd make the lat/lon fields floats instead, which seems to Just Work™.