no-debug
This commit is contained in:
@@ -23,20 +23,17 @@ def add_topic_stat_columns(q):
|
||||
|
||||
q = (
|
||||
q.outerjoin(ShoutTopic, Topic.id == ShoutTopic.topic)
|
||||
.add_columns(func.count(distinct(ShoutTopic.shout))
|
||||
.label("shouts_stat"))
|
||||
.add_columns(func.count(distinct(ShoutTopic.shout)).label("shouts_stat"))
|
||||
|
||||
.outerjoin(aliased_shout_author, ShoutTopic.shout == aliased_shout_author.shout)
|
||||
.add_columns(func.count(distinct(aliased_shout_author.author))
|
||||
.label("authors_stat"))
|
||||
.add_columns(func.count(distinct(aliased_shout_author.user)).label("authors_stat"))
|
||||
|
||||
.outerjoin(aliased_topic_follower)
|
||||
.add_columns(func.count(distinct(aliased_topic_follower.follower))
|
||||
.label("followers_stat"))
|
||||
.add_columns(func.count(distinct(aliased_topic_follower.follower)).label("followers_stat"))
|
||||
)
|
||||
|
||||
q = q.group_by(Topic.id)
|
||||
|
||||
print(f"[resolvers.topics] Generated SQL: {str(q)}") # Add this line for debugging
|
||||
|
||||
return q
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user