Closed SteekDev closed 7 years ago
The queries you are righting are evaluated as sql code, not as python objects. Therefore you can't use the python backrefs to make one-to-many links. The way to deal with this is to construct a query with sqlalchemy that returns what you want, and then pass that query to that datatable. I think you should be able to do this with joining a subquery where you filter for rank = 1 and rank =2, but this quickly gets ugly. See here: https://github.com/Pegase745/sqlalchemy-datatables/issues/83
Model:
Example: Parent_1.id - Parent_1.countChild - Parent_1.Child_1.id - Parent_1.Child_2.id Parent_2.id - Parent_2.countChild - Parent_2.Child_1.id - Parent_2.Child_2.id Parent_3.id - Parent_3.countChild - Parent_3.Child_1.id - Parent_3.Child_2.id