code: def delete(self, for_update=False):
          
          hash_key = self.get_hash_id()
          try:
              original_instance = self.load(hash_key, convert_key=False)
          except KeyError:
              return
  
          # Remove from the `all` index.
          all_index = self._query.all_index()
          all_index.remove(hash_key)
  
          # Remove from the secondary indexes.
          for field in self._indexes:
              for index in field.get_indexes():
                  index.remove(original_instance)
  
          if not for_update:
              for field in self._fields.values():
                  if isinstance(field, _ContainerField):
                      field._delete(self)
  
          # Remove the object itself.
          self.__database__.delete(hash_key)
docs: Delete the given model instance.