          if lookup_type == 'contains':
              # 'contains' name might conflict with the "normal" contains lookup,
              # for which the value is not prepared, but left as-is.
              return self.get_prep_value(value)
  
      def get_db_prep_save(self, value, connection):
          "Prepares the value for saving in the database."
          if not value:
              return None
          else:
 
</s> remove         if lookup_type == 'isnull':
            return bool(value)
        else:
 </s> add         if lookup_type == 'contains':
            # 'contains' name might conflict with the "normal" contains lookup,
            # for which the value is not prepared, but left as-is. </s> remove         return obj.get_compiler(connection=self.connection).as_sql()
 </s> add         return obj.get_compiler(connection=self.connection).as_sql(subquery=True)
        return super(GeometryField, self).get_prep_lookup(lookup_type, value)
          if lookup_type == 'contains':
              # 'contains' name might conflict with the "normal" contains lookup,
              # for which the value is not prepared, but left as-is.
              return self.get_prep_value(value)
        return super(GeometryField, self).get_prep_lookup(lookup_type, value)
  
      def get_db_prep_save(self, value, connection):
          "Prepares the value for saving in the database."
          if not value:
              return None
          else:
keep keep keep add keep keep keep keep keep keep
 Fixed #14483 -- Allowed using subqueries with GIS lookups 
django/contrib/gis/db/models/fields.py