def add_tmp_component(model, name, obj):
    """Add a temporary component to a model, adjusting the
    name as needed to make sure it is unique."""
    while hasattr(model, name):
        name = "." + name + "."
    setattr(model, name, obj)
    return name