Specify the aggregate function for MySQLs GROUP BY.

This commit is contained in:
yackob03 2013-12-27 17:31:20 -05:00
parent d93a8b6033
commit e02c98022d

View file

@ -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))