Add support for Django 3.1

This commit is contained in:
Bastien Vallet
2020-08-05 10:39:48 +02:00
parent 68605ba2ba
commit b6921baede
5 changed files with 13 additions and 6 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)