This commit is contained in:
parent
e80b3ac770
commit
3bc7946ab3
|
@ -103,7 +103,7 @@ def query_follows(author_id: int):
|
||||||
.alias()
|
.alias()
|
||||||
)
|
)
|
||||||
|
|
||||||
subquery_author_followers = (
|
subquery_author_authors = (
|
||||||
select(
|
select(
|
||||||
[
|
[
|
||||||
AuthorFollower.author,
|
AuthorFollower.author,
|
||||||
|
@ -129,7 +129,7 @@ def query_follows(author_id: int):
|
||||||
|
|
||||||
subq_shout_author_alias = alias(subquery_shout_author)
|
subq_shout_author_alias = alias(subquery_shout_author)
|
||||||
subq_author_followers_alias = alias(
|
subq_author_followers_alias = alias(
|
||||||
subquery_author_followers, name='subq_author_followers'
|
subquery_author_authors, name='subq_author_followers'
|
||||||
)
|
)
|
||||||
subq_author_authors_alias = alias(
|
subq_author_authors_alias = alias(
|
||||||
subquery_author_followers, name='subq_author_authors'
|
subquery_author_followers, name='subq_author_authors'
|
||||||
|
@ -139,21 +139,21 @@ def query_follows(author_id: int):
|
||||||
select(
|
select(
|
||||||
[
|
[
|
||||||
Author.id,
|
Author.id,
|
||||||
subq_shout_author_alias.c.shouts_stat,
|
subq_shout_author_alias.shouts_stat,
|
||||||
subq_author_authors_alias.c.authors_stat,
|
subq_author_authors_alias.authors_stat,
|
||||||
subq_author_followers_alias.c.followers_stat,
|
subq_author_followers_alias.followers_stat,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
.select_from(Author)
|
.select_from(Author)
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
subq_shout_author_alias, Author.id == subq_shout_author_alias.c.author
|
subq_shout_author_alias, Author.id == subq_shout_author_alias.author
|
||||||
)
|
)
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
subq_author_authors_alias, Author.id == subq_author_followers_alias.c.author
|
subq_author_authors_alias, Author.id == subq_author_followers_alias.author
|
||||||
)
|
)
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
subq_author_followers_alias,
|
subq_author_followers_alias,
|
||||||
Author.id == subq_author_followers_alias.c.follower,
|
Author.id == subq_author_followers_alias.follower,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -211,15 +211,15 @@ def query_follows(author_id: int):
|
||||||
)
|
)
|
||||||
.select_from(Topic)
|
.select_from(Topic)
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
subq_shout_topic_alias, Topic.id == subq_shout_topic_alias.columns.topic_id
|
subq_shout_topic_alias, Topic.id == subq_shout_topic_alias.columns.topic
|
||||||
)
|
)
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
subq_shout_topic_authors_alias,
|
subq_shout_topic_authors_alias,
|
||||||
Topic.id == subq_shout_topic_authors_alias.columns.topic_id,
|
Topic.id == subq_shout_topic_authors_alias.columns.topic,
|
||||||
)
|
)
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
subq_topic_followers_alias,
|
subq_topic_followers_alias,
|
||||||
Topic.id == subq_topic_followers_alias.columns.topic_id,
|
Topic.id == subq_topic_followers_alias.columns.topic,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user