def _get_by_path_kw(pathlist):
    """ Used by :meth:`get_by_path` to create the required kwargs for
    Node.objects.get(). Might be a starting point for more sophisticated
    queries including paths. Example::

        ifi = Node.objects.get(**Node._get_by_path_kw(['uio', 'ifi']))

    :param pathlist: A list of node-names, like ``['uio', 'ifi']``.
    """
    kw = {}
    key = 'short_name'
    for short_name in reversed(pathlist):
        kw[key] = short_name
        key = 'parentnode__' + key
    return kw