tabo / django-treebeard

Efficient tree implementations for Django 1.0+ :: https://tabo.pe/projects/django-treebeard/

Clone this repository (size: 528.3 KB): HTTPS / SSH
$ hg clone http://code.tabo.pe/django-treebeard

Patch Queues

FIX NS_TREE add_root
themax.ru / FIX NS_TREE add_root
def get_root_nodes(cls): return cls.objects.filter(lft=1) ------------------------- This code can return any order of records. But this: ------------------------- def get_last_root_node(cls): ... return cls.get_root_nodes().reverse()[0] ------------------------- assumes correct order of nodes. Please add .order_by('tree_id') to get_root_nodes. Thanks, Maxim
Clone URL : https://bitbucket.org/themax.ru/fix-ns_tree-add_root (1.3 KB)

Forks