return result
root_nodes = cache_tree_children(Node.objects.all())
dicts = []
for n in root_nodes:
    dicts.append(recursive_node_to_dict(n))
print(json.dumps(dicts, indent=4))
fastest way to create JSON to reflect a tree structure in Python / Django using mptt