Skip to main content

Live demo: django-icv-tree

The package index, as the tree it actually is

django-icv-tree stores hierarchies as materialised paths: every node knows its full ancestry in one indexed column. Below is the real ICV capability hierarchy, not sample data: expand a category, follow the breadcrumb, list every descendant of any node.

Capability tree (root: ICV OSS)

8 packages across 4 categories
ICV OSS 4 items 0001
Foundation 3 items 0001/0001
django-icv-core 0001/0001/0001
django-icv-tree 0001/0001/0002
django-boundary 0001/0001/0003
Content and structure 2 items 0001/0002
django-icv-taxonomy 0001/0002/0001
django-icv-search 0001/0002/0002
Delivery 1 item 0001/0003
django-icv-sitemaps 0001/0003/0001
Security and routing 2 items 0001/0004
django-hostmap 0001/0004/0001
django-waf 0001/0004/0002

Click a name to select it. Click the triangle to expand or collapse its children.

Ancestors of django-icv-core

get_ancestors(include_self=True), one query

Descendants of “django-icv-core”

django-icv-core is a leaf (is_leaf() = true). No descendants to list; this is the correct, expected result for a package node, not a failed query.

Why this is fast Every node's path column is a prefix-indexed string (e.g. 0001/0002/0001). Ancestors and descendants are WHERE path LIKE prefix lookups, not recursive CTEs or nested-set left/right rebalancing on every write.

Same-host stays relative, cross-host goes absolute

Both links below are built the same way, a plain url template tag with no host handling. hostmap decides, per call, whether the result stays relative or becomes absolute.