Created
October 31, 2011 05:28
-
-
Save kenji4569/1326961 to your computer and use it in GitHub Desktop.
descendants_from_node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def descendants_from_node(self, node, include_self=False): | |
db, table_node = self.db, self.settings.table_node | |
node = self._load_node(node) | |
left, right = node.left, node.right | |
if include_self: | |
left -= 1 | |
right += 1 | |
return db(table_node.left > left)(table_node.right < right)( | |
table_node.tree_id == node.tree_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment