-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
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 aall_parents = ArrayField(CharField())to the category model, add a bit of code to keep them updated, and the query basically becomesall_parents__contains=my_category_slug
Originally posted by @winged in #365 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels