Skip to content

Поддержка django 3.1 и выше #79

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion django_elasticsearch/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
except ImportError: # python < 2.7
from django.utils import importlib

from django import VERSION as django_version
from django.conf import settings
try:
from django.utils import importlib
except:
import importlib
from django.db.models import FieldDoesNotExist

if django_version < (3, 1, 0):
from django.db.models import FieldDoesNotExist
else:
from django.core.exceptions import FieldDoesNotExist

from django_elasticsearch.query import EsQueryset
from django_elasticsearch.client import es_client
Expand Down
8 changes: 7 additions & 1 deletion django_elasticsearch/serializers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import json
import datetime

from django.db.models import FieldDoesNotExist
from django import VERSION as django_version

if django_version < (3, 1, 0):
from django.db.models import FieldDoesNotExist
else:
from django.core.exceptions import FieldDoesNotExist

from django.db.models.fields.related import ManyToManyField


Expand Down