You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How should the category filter on the documents traverse the child categories to return all documents from parent and children.
Currently it will only do one layer of children
I think if we need to query categories recursively, we should either use something like MPTT, or cache the parents of each category in an ArrayField. Recursively iterating in a query is a bad idea performance-wise.
Since we didn't have positive-only experience with MPTT, I would suggest adding a all_parents = ArrayField(CharField()) to the category model, add a bit of code to keep them updated, and the query basically becomes all_parents__contains=my_category_slug
How should the category filter on the documents traverse the child categories to return all documents from parent and children.
Currently it will only do one layer of children
Originally posted by @winged in #365 (comment)
The text was updated successfully, but these errors were encountered: