This commit is contained in:
parent
91e4e751d8
commit
1c6678d55d
|
@ -249,14 +249,10 @@ def get_shouts_with_stats(q, limit=20, offset=0, author_id=None):
|
|||
if author_id:
|
||||
query = query.filter(Shout.created_by == author_id)
|
||||
|
||||
# Выполнение запроса и обработка результатов
|
||||
with q.session as session:
|
||||
results = session.execute(query).all()
|
||||
|
||||
# Формирование списка публикаций с их данными
|
||||
shouts = []
|
||||
|
||||
for row in results:
|
||||
with local_session() as session:
|
||||
for row in session.execute(query).all() or []:
|
||||
shout = row.Shout
|
||||
comments_stat = row.comments_stat
|
||||
rating_stat = row.rating_stat
|
||||
|
|
Loading…
Reference in New Issue
Block a user