(parent_node, new_order)
:param parent_node:
    :param new_order: List of child keys, in their new order
    :return:
:param parent_node:
    :param new_order: List of child keys, in their new order
    :return:
: param parent_node : : param new_order : List of child keys in their new order : return :
def reorder_children(parent_node, new_order):
    """
    :param parent_node:
    :param new_order: List of child keys, in their new order
    :return:
    """
    # With this one, we can get away with just an Index change
    assert isinstance(parent_node, SchemaNode)
    child_dict = {n.key: n for n in parent_node.children}
    assert set(child_dict.keys()) == set(new_order)
    parent_node.children = [child_dict[k] for k in new_order]
    parent_node.index.save()
def reorder_children ( parent_node , new_order ) : # With this one, we can get away with just an Index change assert isinstance ( parent_node , SchemaNode ) child_dict = { n . key : n for n in parent_node . children } assert set ( child_dict . keys ( ) ) == set ( new_order ) parent_node . children = [ child_dict [ k ] for k in new_order ] parent_node . index . save ( )