code: def add_root(cls, **kwargs):
          
  
          # do we have a root node already?
          last_root = cls.get_last_root_node()
  
          if last_root and last_root.node_order_by:
              # there are root nodes and node_order_by has been set
              # delegate sorted insertion to add_sibling
              return last_root.add_sibling('sorted-sibling', **kwargs)
  
          if last_root:
              # adding the new root node as the last one
              newtree_id = last_root.tree_id + 1
          else:
              # adding the first root node
              newtree_id = 1
  
          if len(kwargs) == 1 and 'instance' in kwargs:
              # adding the passed (unsaved) instance to the tree
              newobj = kwargs['instance']
              if newobj.pk:
                  raise NodeAlreadySaved("Attempted to add a tree node that is "\
                      "already in the database")
          else:
              # creating the new object
              newobj = get_result_class(cls)(**kwargs)
  
          newobj.depth = 1
          newobj.tree_id = newtree_id
          newobj.lft = 1
          newobj.rgt = 2
          # saving the instance before returning it
          newobj.save()
          return newobj
docs: Adds a root node to the tree.