Adjacency List treesΒΆ

This is a simple implementation of the traditional Adjacency List Model for storing trees in relational databases.

In the adjacency list model, every node will have a “parent” key, that will be NULL for root nodes.

Since django-treebeard must return trees ordered in a predictable way, the ordering for models without the node_order_by attribute will have an extra attribute that will store the relative position of a node between it’s siblings: sib_order.

The adjacency list model has the advantage of fast writes at the cost of slow reads. If you read more than you write, use MP_Node instead.

Previous topic

Nested Sets trees

Next topic

Admin

This Page