diff --git a/ontology/update.py b/ontology/update.py index de51c31..c4dfb43 100755 --- a/ontology/update.py +++ b/ontology/update.py @@ -22,10 +22,12 @@ def find_path(parent, root=None, path=None): return r def get_node(name, children, parent=None): + children_ = [get_node(child, children[child], name) for child in children] + children_.sort(key=lambda c: c['name']) node = { "size": len(children) + 100, "name": name, - "children": [get_node(child, children[child], name) for child in children] + "children": children_ } if not node['children']: del node['children']