def get_innermost_object(obj, dotted_path=None):
    """
    For given object return innermost object.
    """
    if not dotted_path:
        return obj
    for o in dotted_path.split('.'):
        obj = getattr(obj, o)
    return obj