This commit is contained in:
parent
0b185c1c2d
commit
1b22276237
|
@ -15,6 +15,8 @@ def add_topic_stat_columns(q):
|
||||||
q = q.outerjoin(aliased_shout).add_columns(
|
q = q.outerjoin(aliased_shout).add_columns(
|
||||||
func.count(distinct(aliased_shout.shout)).label("shouts_stat")
|
func.count(distinct(aliased_shout.shout)).label("shouts_stat")
|
||||||
)
|
)
|
||||||
|
# Join the Topic table with the Author table
|
||||||
|
q = q.join(Author, TopicFollower.author == Author.id)
|
||||||
aliased_follower = aliased(TopicFollower)
|
aliased_follower = aliased(TopicFollower)
|
||||||
q = q.outerjoin(
|
q = q.outerjoin(
|
||||||
aliased_follower, aliased_follower.follower == Author.id
|
aliased_follower, aliased_follower.follower == Author.id
|
||||||
|
@ -27,6 +29,7 @@ def add_topic_stat_columns(q):
|
||||||
return q
|
return q
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def add_author_stat_columns(q):
|
def add_author_stat_columns(q):
|
||||||
aliased_shout = aliased(ShoutAuthor)
|
aliased_shout = aliased(ShoutAuthor)
|
||||||
q = q.outerjoin(aliased_shout).add_columns(
|
q = q.outerjoin(aliased_shout).add_columns(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user