Add support for Django 3.1
This commit is contained in:
@@ -6,7 +6,7 @@ import copy
|
||||
from collections import defaultdict
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db.models import FieldDoesNotExist
|
||||
from django.core.exceptions import FieldDoesNotExist
|
||||
from django.db.models.query import ModelIterable, Q, QuerySet
|
||||
|
||||
from . import compat
|
||||
|
||||
@@ -7,7 +7,7 @@ from collections import deque
|
||||
|
||||
from django.apps import apps
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import FieldError
|
||||
from django.core.exceptions import FieldError, FieldDoesNotExist
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from django.db.models.fields.related import ForeignObjectRel, RelatedField
|
||||
@@ -187,7 +187,7 @@ def translate_polymorphic_field_path(queryset_model, field_path):
|
||||
# Can also test whether the field exists in the related object to avoid ambiguity between
|
||||
# class names and field names, but that never happens when your class names are in CamelCase.
|
||||
return field_path # No exception raised, field does exist.
|
||||
except models.FieldDoesNotExist:
|
||||
except FieldDoesNotExist:
|
||||
pass
|
||||
|
||||
submodels = _get_all_sub_models(queryset_model)
|
||||
|
||||
Reference in New Issue
Block a user