Closed olivierdalang closed 1 year ago
Thank you!
The documentation doesn't state it clearly but using TreeNode
is supposed to be optional. I have added a new test for this and resolved the conflicts, let's see whether tests pass.
I'm wondering if there isn't a better way to resolve the model having the required parent
foreign key; maybe you could try checking whether a parent
FK exists? I'm not sure if that would be better though.
Hi again
Thanks for your contribution! The test cases were excellent and the implementation helped a lot. I found a different way to fetch the base model and will push a new release soon.
Hey !
Currently, there seem to be a limitation with multi-table inheritance setup when querying subclasses, because the CTE assumes the
parent_id
andid
columns are on the table of the model (while they are on the super model). I stumbled on this when trying to combine django-tree-queries and django-polymorphic (btw if you're aware of such a combination please let me know).This fixes the issue by ensuring the CTE is built against the super model.
Two commits in the PR: first with failing tests, second wit actual fix.