Hacker News new | past | comments | ask | show | jobs | submit login

Unfortunately, this still only gets the children of the root. If you want to be able to recursively get all the children and grandchildren of a root, you're going to be doing (N - leaves) queries where N is the number of Nodes in the tree.

However, there is of course a django package to help with this and gathers all the nodes you care about into one query:

https://github.com/django-mptt/django-mptt




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: