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

Support MySQL JSON Fields #5111

Closed
sergiomb2 opened this issue May 2, 2017 · 2 comments
Closed

Support MySQL JSON Fields #5111

sergiomb2 opened this issue May 2, 2017 · 2 comments

Comments

@sergiomb2
Copy link

as my $dayjob was looking support for mysql 5.7 with json fields , I tried

https://pypi.python.org/pypi/django-jsonfield 
https://pypi.python.org/pypi/jsonfield
from rest_framework.serializers import JSONField
from django.contrib.postgres.fields import JSONField
https://pypi.python.org/pypi/django-mysql

and as asked the same feature for postgres [1] I asked for mysql

Thanks
[1] #3170

@xordoquy
Copy link
Collaborator

xordoquy commented May 2, 2017

Postgres support for JSON field has been made possible by Django supporting it.
Unless Django adds a support for a JSONField for MySQL, we won't add it to DRF.
You can still make it a 3rd party or integrate it "natively" in your project by doing something similar to:

serializer_field_mapping[ModelJSONField] = JSONField

@xordoquy xordoquy closed this as completed May 2, 2017
@sergiomb2
Copy link
Author

sergiomb2 commented May 3, 2017

JFTR : this is done with django-mysql and serializer was fixed some days ago [1], is not yet in any release.

[1] adamchainz/django-mysql#353

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

2 participants