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

Descendants with matching field(s) #10

Closed gevezex closed 3 years ago

gevezex commented 3 years ago

Hi,

Just testing this beautiful library. Was wondering if requesting for de descendants() it is also possible to request the descendants with only matching fields. Or should I do that with a list comprehension on every descendant object? Can imagine that would be multiple queries what would be pitty.

matthiask commented 3 years ago

What do you mean with "matching fields"?

.descendants() returns a queryset, you can absolutely add additional .filter() statements etc. at the end. (If it doesn't work please report a bug!)

gevezex commented 3 years ago

Didn't know it was giving back a queryset. That was exactly what I was looking for. Thnx!