Manager

class django_ltree.managers.TreeManager[source]

This manager augments the django model, allowing it to be queried with tree specific queries

get_queryset()[source]

Returns a queryset with the models ordered by path

Return type:

TreeQuerySet

roots()[source]

Returns the roots of a given model

Return type:

TreeQuerySet

children(path)[source]

Returns the childrens of a given object

Parameters:

path (str)

Return type:

TreeQuerySet

create_child(parent=None, label=None, **kwargs)[source]

Creates a tree child with or without parent

Parameters:
  • parent (TreeModel)

  • label (str)

Return type:

TreeQuerySet