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 for django.models.JSONField #472

Closed
HT-Moh opened this issue Dec 15, 2020 · 2 comments
Closed

Support for django.models.JSONField #472

HT-Moh opened this issue Dec 15, 2020 · 2 comments

Comments

@HT-Moh
Copy link

HT-Moh commented Dec 15, 2020

Hi
As I am using the last Django version which has JSONField integrated, and it will be great if we add the support for it to prevent adding external library.
I will suggest the following change on jsonfield.py file :

if USE_JSONFIELD:
    try:
        from models import JSONField

        DataField = JSONField
    except ImportError as err:
        try:
            from jsonfield_compat import JSONField, register_app

            DataField = JSONField
        except ImportError as err:
            try:
                from django_mysql.models import JSONField

                DataField = JSONField

            except ImportError:
                raise ImproperlyConfigured(
                    "You must either install django-jsonfield + "
                    "django-jsonfield-compat, or django-mysql as an "
                    "alternative, if you wish to use a JSONField on your "
                    "actions"
                )

@auvipy
Copy link
Collaborator

auvipy commented Dec 15, 2020

please provide a full PR

@lociii
Copy link
Contributor

lociii commented Jan 14, 2021

This has been resolved in the now merged #474

@auvipy auvipy closed this as completed Jan 14, 2021
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