left-join-fix
This commit is contained in:
@@ -119,6 +119,7 @@ def get_author_comments_stat(author_id: int):
|
|||||||
select(
|
select(
|
||||||
Author.id, func.coalesce(func.count(Reaction.id)).label("comments_count")
|
Author.id, func.coalesce(func.count(Reaction.id)).label("comments_count")
|
||||||
)
|
)
|
||||||
|
.select_from(Author) # явно указываем левый элемент join'а
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
Reaction,
|
Reaction,
|
||||||
and_(
|
and_(
|
||||||
|
|||||||
Reference in New Issue
Block a user