Nested Sets trees¶
Nested sets have very efficient reads at the cost of high maintenance on write/delete operations.
As with all tree implementations, please be aware of the Known Caveats.
Abstract model to create your own Nested Sets Trees.
Also, if in your manager you need to change the default queryset handler, you’ll need to subclass
Attribute: a list of model fields that will be used for node ordering. When enabled, all tree operations will assume this ordering.
node_order_by = ['field1', 'field2', 'field3']
PositiveIntegerField, depth of a node in the tree. A root node has a depth of 1.
Returns: A queryset of nodes ordered as DFS, including the parent. If no parent is given, all trees are returned.
This metod returns a queryset.
Custom manager for nodes in a Nested Sets tree.