manage.py loaddata fails when loading python serialized code
|Reported by:||Owned by:||nobody|
|Cc:||django@…||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I dumped my database using the python format serializer:
./manage.py dumpdata app --format=python > app/fixtures/1.python
When loading the app I get the error message:
$ ./manage.py loaddata 1.python Loading '2' fixtures... Installing python fixture '2' from 'app/fixtures'. Problem installing fixture 'app/fixtures/2.python': string indices must be integers
The problem is that the python deserializer is trying to loop over a string and not python objects.
I've attached a hack to fix the problem, I was unsure of the best place to put the patch so I added it to __init__.py, please advise on better placement.