Closed RomanSarnov closed 2 years ago
You can run clean sqlalchemy request
level Nested sets example
1 1(1)22 ---------------------
_______________|_________|_________ |
| | | | |
2 2(2)5 6(4)11 | 12(7)21 |
| ^ | ^ |
3 3(3)4 7(5)8 9(6)10 | 13(8)16 17(10)20 |
| | | |
4 | 14(9)15 18(11)19 |
| |
---------------------
query = query.filter(table.tree_id == 1)\
.filter(table.left >= 12)\
.filter(table.right <= 21)
or use the method from the library
How i can get all children recursive as base query sqlalchemy?