def _get_old_pk(instance, field_name):
    """ Given a model instance & field_name find the true name of the field
    This is needed to support the uncommon scenario where the
    instance's ForeignKey column name may have been overridden
    from the django default behavior of <field_name>_id.
    Using `get_attname` will return whatever the real fields name
    is that has just the foreign key value.
    """
    model_field_name = instance._meta.get_field(field_name).get_attname()
    return getattr(instance, model_field_name)
