<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_original_fields(instance):
 """ Save fields value, only for non-m2m fields. """

    original_fields = {}

    def _set_original_field(instance, field):
        if instance.pk is None:
            original_fields[field] = None
        else:
            if isinstance(instance._meta.get_field(field), ForeignKey):
                # Only get the PK, we don't want to get the object
                # (which would make an additional request)
                original_fields[field] = getattr(instance,
                                                 '{0}_id'.format(field))
            else:
                original_fields[field] = getattr(instance, field)

    for field in getattr(instance, '_tracked_fields', []):
        _set_original_field(instance, field)
    for field in getattr(instance, '_tracked_related_fields', {}).keys():
        _set_original_field(instance, field)

    instance._original_fields = original_fields
    # Include pk to detect the creation of an object
    instance._original_fields['pk'] = instance.pk