          using = using or router.db_for_write(self.__class__, instance=self)
          if force_insert and (force_update or update_fields):
              raise ValueError("Cannot force both insert and updating in model saving.")
  
          if update_fields is not None:
              # If update_fields is empty, skip the save. We do also check for
              # no-op saves later on for inheritance cases. This bailout is
              # still needed for skipping signal sending.
              if len(update_fields) == 0:
 
</s> remove         elif not force_insert and self._deferred and using == self._state.db:
 </s> add         elif not force_insert and deferred_fields and using == self._state.db: </s> remove             deferred_fields = [
                f.attname for f in self._meta.fields
                if (f.attname not in self.__dict__ and
                    isinstance(self.__class__.__dict__[f.attname], DeferredAttribute))
            ]

 </s> add  </s> remove             # This slightly odd construct is so that we can access any
            # data-descriptor object (DeferredAttribute) without triggering its
            # __get__ method.
            if (field.attname not in kwargs and
                    (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute) or
                        field.column is None)):
                # This field will be populated on request.
 </s> add             # Virtual field
            if field.attname not in kwargs and field.column is None: </s> remove # This function is needed because data descriptors must be defined on a class
# object, not an instance, to have any effect.

def deferred_class_factory(model, attrs):
    """
    Returns a class object that is a copy of "model" with the specified "attrs"
    being replaced with DeferredAttribute objects. The "pk_value" ties the
    deferred attributes to a particular instance of the model.
    """
    if not attrs:
        return model
    opts = model._meta
    # Never create deferred models based on deferred model
    if model._deferred:
        # Deferred models are proxies for the non-deferred model. We never
        # create chains of defers => proxy_for_model is the non-deferred
        # model.
        model = opts.proxy_for_model
    # The app registry wants a unique name for each model, otherwise the new
    # class won't be created (we get an exception). Therefore, we generate
    # the name using the passed in attrs. It's OK to reuse an existing class
    # object if the attrs are identical.
    name = "%s_Deferred_%s" % (model.__name__, '_'.join(sorted(attrs)))
    name = utils.truncate_name(name, 80, 32)

    try:
        return opts.apps.get_model(model._meta.app_label, name)

    except LookupError:

        class Meta:
            proxy = True
            apps = opts.apps
            app_label = opts.app_label

        overrides = {attr: DeferredAttribute(attr, model) for attr in attrs}
        overrides["Meta"] = Meta
        overrides["__module__"] = model.__module__
        overrides["_deferred"] = True
        return type(str(name), (model,), overrides)


 </s> add  </s> remove         model = obj._meta.proxy_for_model if obj._deferred else obj.__class__
        attrs = OrderedDict([("model", smart_text(model._meta))])
 </s> add         attrs = OrderedDict([("model", smart_text(obj._meta))])
        deferred_fields = self.get_deferred_fields()
          using = using or router.db_for_write(self.__class__, instance=self)
          if force_insert and (force_update or update_fields):
              raise ValueError("Cannot force both insert and updating in model saving.")
  
        deferred_fields = self.get_deferred_fields()
          if update_fields is not None:
              # If update_fields is empty, skip the save. We do also check for
              # no-op saves later on for inheritance cases. This bailout is
              # still needed for skipping signal sending.
              if len(update_fields) == 0:
keep keep keep add keep keep keep keep keep
 Fixed #26207 -- Replaced dynamic classes with non-data descriptors for deferred instance loading. 
django/db/models/base.py