Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong default value for South migration #32

Open
fangsterr opened this issue Nov 3, 2013 · 2 comments
Open

Wrong default value for South migration #32

fangsterr opened this issue Nov 3, 2013 · 2 comments

Comments

@fangsterr
Copy link

I create a new field on my model as such:

some_json_field = JSONField(default=[], blank=True)

However, when I generate the schemamigration (using python manage.py schemamigration appname --auto) and migrate, the field on existing model instances for the some_json_field are the string "[]" instead of []

@derek-schaefer
Copy link
Owner

Thanks for reporting this. I'll look into it.

@mboersma
Copy link

We've seen a similar problem with a field default of "{}", which is intended to be an empty JSON object but gets encoded as the literal unicode string "{}". I couldn't figure out exactly where this goes wrong, so I applied a band-aid in our product: deis/deis#1616

If anyone knows where this might be happening, I would love to debug it and push a fix back upstream to django-json-field. It's worked great for us other than this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants