          self._field = field
          self._klass = klass
  
      def __get__(self, instance, cls=None):
          """
          This accessor retrieves the geometry or raster, initializing it using
          the corresponding class specified during initialization and the value
          of the field. Currently, GEOS or OGR geometries as well as GDALRasters
 
</s> remove class SpatialProxy(object):
 </s> add class SpatialProxy(DeferredAttribute): </s> remove     def __set__(self, instance, value):
        """
        Deferred loading attributes can be set normally (which means there will
        never be a database lookup involved.
        """
        instance.__dict__[self.field_name] = value

 </s> add  </s> remove         geo_value = instance.__dict__[self._field.attname]
 </s> add         try:
            geo_value = instance.__dict__[self._field.attname]
        except KeyError:
            geo_value = super(SpatialProxy, self).__get__(instance, cls) </s> remove         count = 0
        for field in obj._meta.fields:
            if isinstance(obj.__class__.__dict__.get(field.attname), DeferredAttribute):
                count += 1
 </s> add         count = len(obj.get_deferred_fields())
        super(SpatialProxy, self).__init__(field.attname, klass)
          self._field = field
          self._klass = klass
        super(SpatialProxy, self).__init__(field.attname, klass)
  
      def __get__(self, instance, cls=None):
          """
          This accessor retrieves the geometry or raster, initializing it using
          the corresponding class specified during initialization and the value
          of the field. Currently, GEOS or OGR geometries as well as GDALRasters
keep add keep keep keep keep keep keep
 Fixed #26207 -- Replaced dynamic classes with non-data descriptors for deferred instance loading. 
django/contrib/gis/db/models/proxy.py