def get_field_value(instance, field_name, use_get):
    """Get a field value given an instance."""
    if use_get:
        field_value = instance.get(field_name)
    else:
        field_value = getattr(instance, field_name, '')
    return field_value