groupby-fix

This commit is contained in:
Untone 2024-03-06 15:16:29 +03:00
parent 54eeb5b549
commit b13d57ca17

View File

@ -54,9 +54,7 @@ def add_topic_stat_columns(q):
func.coalesce(func.sum(sub_comments.c.comments_count), 0).label('comments_stat')
)
q = q.group_by(
Topic.id, 'shouts_stat', 'authors_stat', 'followers_stat', 'comments_stat'
)
q = q.group_by(Topic.id, sub_comments.c.comments_stat)
return q