def _check_field_changed(instance, old_instance, field_name, update_fields=None):
    """
    Examines update_fields and an attribute of an instance to determine if
    that attribute has changed prior to the instance being saved.

    Parameters
    ----------
    field_name : str
    instance : object
    old_instance : object
    update_fields : list of str, optional
    """
    if update_fields is not None and field_name not in update_fields:
        return False

    return getattr(instance, field_name) != getattr(old_instance, field_name)
def _check_field_changed ( instance , old_instance , field_name , update_fields = None ) : if update_fields is not None and field_name not in update_fields : return False return getattr ( instance , field_name ) != getattr ( old_instance , field_name )
Examines update_fields and an attribute of an instance to determine if
    that attribute has changed prior to the instance being saved.

    Parameters
    ----------
    field_name : str
    instance : object
    old_instance : object
    update_fields : list of str, optional