Closed ghostbody closed 7 years ago
Could you please try and see if the recent updates would solve your issue? It should look something like this:
from sqlalchemy import func
columns = [
ColumnDT(Team.team_id),
ColumnDT(Team.name),
ColumnDT(func.count(CourseMember. member_id)
]
query=session.query().\
select_from(Team).\
join(CourseMember).\
group_by(Team.team_id, Team.name)
I have the following schema for my ORM:
Table Member
Table Team
I am wondering how to build a dataTable using datatable-sqlachemy to get the flowing items:
I do not know how to count the members with only one class int
session.query(Team).cascaded_operations()
Is there a possible way for this usage? Thank you very much.