in my code i have:
json.dumps({'foo': {'bar': [123L, 123L]}})
the long ints are primary keys. this line for some reason generates the error:
"[123L, 123L] is not JSON serializable"
When i try to execute it in python manage.py shell:
json.dumps({'foo': {'bar': [123L, 123L]}})
works fine.
Can anyone tell me what's going on?
exact Django error:
Exception Type: TypeError Exception Value: [123L] is not JSON serializable Exception Location: /usr/lib/python2.7/dist-packages/simplejson/encoder.py in default, line 192
This works for me: