parameters: (parent_node, new_order)
docstring: :param parent_node:
      :param new_order: List of child keys, in their new order
      :return:
docstring_summary: :param parent_node:
      :param new_order: List of child keys, in their new order
      :return:
docstring_tokens: : param parent_node : : param new_order : List of child keys in their new order : return :
function: 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()
function_tokens: 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 ( )