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
427 stars 27 forks source link

Children only #9

Closed gevezex closed 3 years ago

gevezex commented 3 years ago

How can I get only the children instead of all the decsendants?

matthiask commented 3 years ago

Hey @gevezex

Use node.children.all(), or whatever the related_name value of your model is.

This isn't specific to django-tree-queries; just use Django's related manager for this.

I hope this helps :)

gevezex commented 3 years ago

Thnx! And also thnx for this great library 👏🏼

matthiask commented 3 years ago

Thank you! You're welcome :)