bradjasper/django-jsonfield — Issue #9: Type changed to unicode in dumpdata
Author: jlev
Created: 2011-11-04 22:19:37+00:00
State: open

I'm using this to cache responses from a web api, without having to define fields for each of the possible response types. Works great when I first save the jsonfield, but when I backup the database via loaddata and reload, the jsonfield is all unicode. Strangely, I can't seem to turn it back into json via the to_python method or json.loads, as I get a ValueError: Expecting property name: line 1 column 1 (char 1) on the u character. I can call eval on the unicode, but I'm not entirely sure that's safe. Other ideas?