Exemple #1
0
 def __eq__(self, other):
     """ Determine if this node is equal to ``other``. """
     if other.__class__ == Node:
         nd_self = self.node_data
         nd_other = core.get_node(self._cursor, other.id)
         return nd_self.to_dict() == nd_other.to_dict()
     return False
Exemple #2
0
    def get_node(self, node_id):
        """
        Get node with given database ID.

        :param int node_id: Database ID
        """
        node_id = core.get_node(self.cursor, node_id).id
        return self.node_factory(self, node_id)
    def get_node(self, node_id):
        """
        Get node with given database ID.

        :param int node_id: Database ID
        """
        node_id = core.get_node(self.cursor, node_id).id
        return self.node_factory(self, node_id)
Exemple #4
0
 def _node_data(self):
     """
     Return a :class:`libtree.core.node_data.NodeData` object for
     current node ID from database.
     """
     return core.get_node(self._cursor, self.id)
Exemple #5
0
 def __eq__(self, other):
     if other.__class__ == Node:
         nd_self = self._node_data
         nd_other = core.get_node(self._cursor, other.id)
         return nd_self.to_dict() == nd_other.to_dict()
     return False
Exemple #6
0
 def node_data(self):
     """
     Get a :class:`libtree.core.node_data.NodeData` object for
     current node ID from database.
     """
     return core.get_node(self._cursor, self.id)