I\'m building large mptt tree. I\'d like to insert all nodes and after that start method for rebuilding whole tree:
I have the following tree structure: Cat 1 --Sub Cat 开发者_StackOverflow中文版1 --Sub Cat 2 Cat 2 --Sub Cat 1
I\'m using Django-MPTT to do a display a simple 2 level hierarchy (root => child(ren)). I\'m looking for a way to structure my queryset so that nodes get returned with the root node having the most ch
Does anybody have an efficient algorithm to retrieve all ancestors of an mptt queryset? The best I could think of so far is something like this:
I have a model which I can instantiate just fine, but once created, if I attempt to save it I get an IntegrityError saying that the primary key must be unique.What\'s causing this?
Hi i\'ve been looking all over and can\'t find the answer to this. I have only 3 months experience in using python/django so excuse my dummy quesion!
I\'ve been banging my head against the desk for a couple weeks on this problem, so I figure it may be time to seek some help.
I have installed django-mptt and have followed the documentation regarding setting up a Django model for MPTT
models.py class Category(MPTTModel): name = models.CharField(max_length=100) slug = models.SlugField(max_length=200, unique=True)
The model I\'m using at the 开发者_高级运维moment essentially has three classes. A root class, a tree attached to the root class and a leaf node class that can be attached anywhere in the tree.