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:
|
if author_id:
|
||||||
query = query.filter(Shout.created_by == author_id)
|
query = query.filter(Shout.created_by == author_id)
|
||||||
|
|
||||||
# Выполнение запроса и обработка результатов
|
|
||||||
with q.session as session:
|
|
||||||
results = session.execute(query).all()
|
|
||||||
|
|
||||||
# Формирование списка публикаций с их данными
|
# Формирование списка публикаций с их данными
|
||||||
shouts = []
|
shouts = []
|
||||||
|
with local_session() as session:
|
||||||
for row in results:
|
for row in session.execute(query).all() or []:
|
||||||
shout = row.Shout
|
shout = row.Shout
|
||||||
comments_stat = row.comments_stat
|
comments_stat = row.comments_stat
|
||||||
rating_stat = row.rating_stat
|
rating_stat = row.rating_stat
|
||||||
|
|
Loading…
Reference in New Issue
Block a user