groupbyfix

This commit is contained in:
Untone 2024-08-07 11:52:16 +03:00
parent 1b46184781
commit 520b39cb0b
2 changed files with 6 additions and 6 deletions

2
cache/precache.py vendored
View File

@ -84,7 +84,7 @@ async def precache_data():
q = select(Topic).where(Topic.community == 1)
topics = get_with_stat(q)
for topic in topics:
topic_dict = topic.dict() if hasattr(topic, 'dict') else topic
topic_dict = topic.dict() if hasattr(topic, "dict") else topic
await cache_topic(topic_dict)
await asyncio.gather(
precache_topics_followers(topic["id"], session), precache_topics_authors(topic_dict["id"], session)

View File

@ -126,7 +126,7 @@ def query_shouts():
reaction_stats_subquery.c.comments_stat,
reaction_stats_subquery.c.rating_stat,
authors_subquery.c.authors,
topics_subquery.c.topics
topics_subquery.c.topics,
)
return q, aliased_reaction