docs: def transform_field(instance, source_field_name, destination_field_name, transformation):
      '''
      Does an image transformation on a instance. It will get the image
      from the source field attribute of the instnace, then call
      the transformation function with that instance, and finally
      save that transformed image into the destination field attribute
      of the instance.
  
      .. note::
  
          If the source field is blank or the transformation returns
          a false value then the destination field image will be deleted, if it
          exists.
  
      .. warning::
  
          When the model instance is saved with the new transformed image, it uses
          the ``update_fields`` argument for
          :py:meth:`~django.db.models.Model.save`, to tell the model to only update
          the destination field and, if set in the destination field, the
          :py:attr:`~django.db.models.ImageField.height_field` and
          :py:attr:`~django.db.models.ImageField.width_field`. This means that
          if the saving code for the model sets any other fields, in the saving
          field process, it will not save those fields to the database. This would
          only happen if you introduce custom logic to the saving process of
          destination field, like the dimension fields do, that updates another field
          on that module. In that case, when the model is saved for the
          transformation, that other field will not be saved to the database.
  
  
      :param instance: model instance to perform transformations on
      :type instance: instance of :py:class:`django.db.models.Model`
  
      :param source_field_name: field name on model to find source image
      :type source_field_name: string
  
      :param destination_field_name: field name on model save transformed image to
      :type destination_field_name: string
  
      :param transformation: function, such as :py:func:`~.transforms.scale`, that takes an image files and returns a transformed image
      :type transformation: function
      '''
  
      source_field = getattr(instance, source_field_name)
      destination_field = getattr(instance, destination_field_name)
      update_fields = [destination_field_name]
      transformed_image = get_transformed_image(source_field, transformation)
      if transformed_image:
          destination_name = os.path.basename(source_field.name)
          dimension_field_names = [
              destination_field.field.height_field,
              destination_field.field.width_field]
          update_fields += filter(None, dimension_field_names)
          destination_field.save(
              destination_name,
              transformed_image,
              save=False
          )
      elif destination_field:
          destination_field.delete()
      else:
          return
      instance.save(update_fields=update_fields)