def get_tree_for_studio_id(self, studio_id):
        """
        Returns the full json tree (recusive calls to /api/get_nodes_by_ids_complete)
        """
        channel_parent = {'children': []}  # this is like _ with children
        def _build_subtree(parent, studio_id):
            subtree = self.get_nodes_by_ids_complete(studio_id)
            if 'children' in subtree:
                children_refs = subtree['children']
                subtree['children'] = []
                for child_studio_id in children_refs:
                    _build_subtree(subtree, child_studio_id)
            parent['children'].append(subtree)
        _build_subtree(channel_parent, studio_id)
        channel = channel_parent['children'][0]
        return channel
def get_tree_for_studio_id ( self , studio_id ) : channel_parent = { 'children' : [ ] } def _build_subtree ( parent , studio_id ) : subtree = self . get_nodes_by_ids_complete ( studio_id ) if 'children' in subtree : children_refs = subtree [ 'children' ] subtree [ 'children' ] = [ ] for child_studio_id in children_refs : _build_subtree ( subtree , child_studio_id ) parent [ 'children' ] . append ( subtree ) _build_subtree ( channel_parent , studio_id ) channel = channel_parent [ 'children' ] [ 0 ] return channel
Returns the full json tree (recusive calls to /api/get_nodes_by_ids_complete)