{"action":"created","issue":{"url":"https://api.github.com/repos/bradjasper/django-jsonfield/issues/119","labels_url":"https://api.github.com/repos/bradjasper/django-jsonfield/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/bradjasper/django-jsonfield/issues/119/comments","events_url":"https://api.github.com/repos/bradjasper/django-jsonfield/issues/119/events","html_url":"https://github.com/bradjasper/django-jsonfield/issues/119","id":57225601,"number":119,"title":"Field may not get deserialized during South data migration","user":{"login":"yigor","id":4971985,"avatar_url":"https://avatars.githubusercontent.com/u/4971985?v=3","gravatar_id":"","url":"https://api.github.com/users/yigor","html_url":"https://github.com/yigor","followers_url":"https://api.github.com/users/yigor/followers","following_url":"https://api.github.com/users/yigor/following{/other_user}","gists_url":"https://api.github.com/users/yigor/gists{/gist_id}","starred_url":"https://api.github.com/users/yigor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yigor/subscriptions","organizations_url":"https://api.github.com/users/yigor/orgs","repos_url":"https://api.github.com/users/yigor/repos","events_url":"https://api.github.com/users/yigor/events{/privacy}","received_events_url":"https://api.github.com/users/yigor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-10T19:41:47Z","updated_at":"2015-03-17T13:48:22Z","closed_at":null,"body":"Hello, I faced a situation when data in one field got corrupted because if was't deserialized on load.  If happens if during South data migration JSONField gets assigned before the id field. It's related to these issues: #116 and #52. In the pre_init method you check that the pk field is assigned which causes the fields's value to remain as a string. And after I save the model the {\"key\":\"value\"} JSON turns into \"{\\\"key\\\":\\\"value\\\"}\" string. And if you run one more migration on this model you'll get \"{\\\\\\\"key\\\\\\\":\\\\\\\"value\\\\\\\"}\" and so on. As I don't see the point in this check I've created a straightforward pull request addressing this issue: #118. This change solved my problem and as far as I see didn't break anything but there may be some pitfall's I'm not aware of. \r\nI use Django 1.6.10 and South 1.0.2."},"comment":{"url":"https://api.github.com/repos/bradjasper/django-jsonfield/issues/comments/82360509","html_url":"https://github.com/bradjasper/django-jsonfield/issues/119#issuecomment-82360509","issue_url":"https://api.github.com/repos/bradjasper/django-jsonfield/issues/119","id":82360509,"user":{"login":"EmilStenstrom","id":224130,"avatar_url":"https://avatars.githubusercontent.com/u/224130?v=3","gravatar_id":"","url":"https://api.github.com/users/EmilStenstrom","html_url":"https://github.com/EmilStenstrom","followers_url":"https://api.github.com/users/EmilStenstrom/followers","following_url":"https://api.github.com/users/EmilStenstrom/following{/other_user}","gists_url":"https://api.github.com/users/EmilStenstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/EmilStenstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EmilStenstrom/subscriptions","organizations_url":"https://api.github.com/users/EmilStenstrom/orgs","repos_url":"https://api.github.com/users/EmilStenstrom/repos","events_url":"https://api.github.com/users/EmilStenstrom/events{/privacy}","received_events_url":"https://api.github.com/users/EmilStenstrom/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T13:48:22Z","updated_at":"2015-03-17T13:48:22Z","body":"Using your branch solved this issue for me. We had simple model instances with JSONFields. Running a south DataMigration over those instances and changing another field (in our case just writing to a field called \"title\" and saving), make our jsonfield turn out with quotes around it. \r\n\r\nRunning on @yigor s branch fixed this issue for us, so that's what we're doing for now.\r\n\r\nWould love for @bradjasper to merge this so we can go back to using a pypi version instead of a tarball from github."}}