#NEWLINE# def _move_child_to_new_tree( self , node , target , position ) : #NEWLINE# #INDENT# '\n        Moves child node ``node`` to a different tree, inserting it\n        relative to the given ``target`` node in the new tree as\n        specified by ``position``.\n\n        ``node`` will be modified to reflect its new tree state in the\n        database.\n        ' #NEWLINE# left = getattr ( node , self . left_attr ) #NEWLINE# right = getattr ( node , self . right_attr ) #NEWLINE# level = getattr ( node , self . level_attr ) #NEWLINE# target_left = getattr ( target , self . left_attr ) #NEWLINE# target_right = getattr ( target , self . right_attr ) #NEWLINE# target_level = getattr ( target , self . level_attr ) #NEWLINE# tree_id = getattr ( node , self . tree_id_attr ) #NEWLINE# new_tree_id = getattr ( target , self . tree_id_attr ) #NEWLINE# ( space_target , level_change , left_right_change , parent ) = self . _calculate_inter_tree_move_values ( node , target , position ) #NEWLINE# tree_width = ( ( right - left ) + 1 ) #NEWLINE# self . _create_space ( tree_width , space_target , new_tree_id ) #NEWLINE# self . _inter_tree_move_and_close_gap ( node , level_change , left_right_change , new_tree_id , parent . pk ) #NEWLINE# setattr ( node , self . left_attr , ( left - left_right_change ) ) #NEWLINE# setattr ( node , self . right_attr , ( right - left_right_change ) ) #NEWLINE# setattr ( node , self . level_attr , ( level - level_change ) ) #NEWLINE# setattr ( node , self . tree_id_attr , new_tree_id ) #NEWLINE# setattr ( node , self . parent_attr , parent )