Create a TrackedFieldModification for the instance.

    :param event: The TrackingEvent on which to add TrackingField
    :param instance: The instance on which the field is
    :param field: The field name to track
    :param fieldname: The displayed name for the field. Default to field.

def _create_tracked_field(event, instance, field, fieldname=None):
    """
    Create a TrackedFieldModification for the instance.

    :param event: The TrackingEvent on which to add TrackingField
    :param instance: The instance on which the field is
    :param field: The field name to track
    :param fieldname: The displayed name for the field. Default to field.
    """
    fieldname = fieldname or field
    if isinstance(instance._meta.get_field(field), ForeignKey):
        # We only have the pk, we need to get the actual object
        model = instance._meta.get_field(field).remote_field.model
        pk = instance._original_fields[field]
        try:
            old_value = model.objects.get(pk=pk)
        except model.DoesNotExist:
            old_value = None
    else:
        old_value = instance._original_fields[field]
    return TrackedFieldModification.objects.create(
        event=event,
        field=fieldname,
        old_value=_serialize_field(old_value),
        new_value=_serialize_field(getattr(instance, field))
    )