node = session.query(TreeNode).options(joinedload_all('children',
    'children', 'children', 'children')).filter(TreeNode.name == 'rootnode'
    ).first()
Creating a tree from self referential tables in SQLalchemy