postquery-topics-authors2

This commit is contained in:
Untone 2024-08-07 12:23:56 +03:00
parent 5609184d3b
commit ad320ae83e

View File

@ -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]