0.4.10-a
All checks were successful
Deploy on push / deploy (push) Successful in 44s

This commit is contained in:
2025-02-11 12:00:35 +03:00
parent 25b61c6b29
commit 5d87035885
27 changed files with 299 additions and 536 deletions

View File

@@ -67,10 +67,7 @@ def add_author_stat_columns(q):
shouts_subq = (
select(func.count(distinct(Shout.id)))
.select_from(ShoutAuthor)
.join(Shout, and_(
Shout.id == ShoutAuthor.shout,
Shout.deleted_at.is_(None)
))
.join(Shout, and_(Shout.id == ShoutAuthor.shout, Shout.deleted_at.is_(None)))
.where(ShoutAuthor.author == Author.id)
.scalar_subquery()
)
@@ -85,10 +82,7 @@ def add_author_stat_columns(q):
# Основной запрос
q = (
q.select_from(Author)
.add_columns(
shouts_subq.label("shouts_stat"),
followers_subq.label("followers_stat")
)
.add_columns(shouts_subq.label("shouts_stat"), followers_subq.label("followers_stat"))
.group_by(Author.id)
)