feincms / django-tree-queries

Adjacency-list trees for Django using recursive common table expressions. Supports PostgreSQL, sqlite, MySQL and MariaDB.
https://django-tree-queries.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
433 stars 27 forks source link

Question: Descendants function #43

Closed marekliska1 closed 2 years ago

marekliska1 commented 2 years ago

Hello, did I understand correctly that the "descendants function" only returns descendants in the first line? Is there no way to get all descendants of descendants? In other words the whole tree structure?

matthiask commented 2 years ago

I don't think that's accurate. There may be bugs, but descendants really shouldn't do the same thing as .children.all() does.

Here's a test, too: https://github.com/matthiask/django-tree-queries/blob/ebb257e8b73f9bf267d5e8eee99f53b23e6a4f4a/tests/testapp/test_queries.py#L250-L262

marekliska1 commented 2 years ago

Yes, you're right. I'm sorry, it was a mistake on my part. It's working as it should, which means I get all the descendants up to the end of the tree structure. Thanks for this library!

matthiask commented 2 years ago

Thanks, you're welcome!