  import inspect
  from collections import namedtuple
  
  from django.core.exceptions import FieldDoesNotExist
  from django.db.backends import utils
  from django.db.models.constants import LOOKUP_SEP
  from django.utils import tree
  
  # PathInfo is used when converting lookups (fk__somecol). The contents
  # describe the relation in Model terms (model Options and Fields for both
 
</s> remove from django.db.models.query_utils import RegisterLookupMixin
 </s> add from django.db.models.query_utils import DeferredAttribute, RegisterLookupMixin </s> remove from django.db.models.query_utils import (
    DeferredAttribute, deferred_class_factory,
)
 </s> add  </s> remove from django.utils.encoding import force_str, force_text
 </s> add from django.utils.encoding import (
    force_str, force_text, python_2_unicode_compatible,
) </s> remove     InvalidQuery, Q, check_rel_lookup_compatibility, deferred_class_factory,
 </s> add     InvalidQuery, Q, check_rel_lookup_compatibility, </s> remove from django.db.models.base import Model  # NOQA isort:skip
 </s> add from django.db.models.base import DEFERRED, Model  # NOQA isort:skip
  import inspect
  from collections import namedtuple
  
  from django.core.exceptions import FieldDoesNotExist

  from django.db.models.constants import LOOKUP_SEP
  from django.utils import tree
  
  # PathInfo is used when converting lookups (fk__somecol). The contents
  # describe the relation in Model terms (model Options and Fields for both
keep keep keep keep replace keep keep keep keep keep
 Fixed #26207 -- Replaced dynamic classes with non-data descriptors for deferred instance loading. 
django/db/models/query_utils.py