Closed jmbarbier closed 2 years ago
Hi @jmbarbier
The documentation is still very sparse so I'm afraid that the test suite is still the best place to document these things; I added a test for filtering by depth, see the referenced commit above or here:
Thanks!
This is more a help request than a bug...
Transitioning from django-mptt, all my tree needs are so far OK using django-tree-queries, except one : i work on pretty deep trees, and i need to filter on max depth.
filter(tree_depth__lte=4)
is not possible with django-tree-queries.I use for now a
filter(Q(parent__isnull=True) | Q(parent__parent__isnull=True) | (...)__isnull=True)
but this is a bit ugly. I could also store the depth into model, but this is a step back from django-tree-queriesWhat would be the more django-tree-queries-way to do this ?
Thanks