postquery-topics-authors2
This commit is contained in:
parent
5609184d3b
commit
ad320ae83e
|
@ -83,7 +83,7 @@ def get_shouts_with_stats(q, limit, offset=0, author_id=None):
|
||||||
|
|
||||||
# Выполнение запроса и обработка результатов
|
# Выполнение запроса и обработка результатов
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
results = session.execute(q, {"author_id": author_id}).all()
|
results = session.execute(q, {"author_id": author_id}).all() if author_id else session.execute(q).all()
|
||||||
|
|
||||||
# Получаем все ID публикаций
|
# Получаем все ID публикаций
|
||||||
shout_ids = [row.Shout.id for row in results]
|
shout_ids = [row.Shout.id for row in results]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user