Specify the aggregate function for MySQLs GROUP BY.
This commit is contained in:
parent
d93a8b6033
commit
e02c98022d
1 changed files with 1 additions and 1 deletions
|
@ -396,7 +396,7 @@ def get_matching_users(username_prefix, robot_namespace=None,
|
|||
(User.robot == True)))
|
||||
|
||||
query = (User
|
||||
.select(User.username, Team.id, User.robot)
|
||||
.select(User.username, fn.Sum(Team.id), User.robot)
|
||||
.group_by(User.username)
|
||||
.where(direct_user_query))
|
||||
|
||||
|
|
Reference in a new issue