fixes-refactoring-and-views
This commit is contained in:
@@ -13,7 +13,7 @@ from services.stat.reacted import ReactedStorage
|
||||
|
||||
async def get_reaction_stat(reaction_id):
|
||||
return {
|
||||
# "viewed": await Stat.get_reaction(reaction_id),
|
||||
# "viewed": await ViewStat.get_reaction(reaction_id),
|
||||
"reacted": len(await ReactedStorage.get_reaction(reaction_id)),
|
||||
"rating": await ReactedStorage.get_reaction_rating(reaction_id),
|
||||
"commented": len(await ReactedStorage.get_reaction_comments(reaction_id)),
|
||||
|
@@ -9,7 +9,7 @@ from orm.topic import Topic, TopicFollower
|
||||
from services.zine.topics import TopicStorage
|
||||
from services.stat.reacted import ReactedStorage
|
||||
from services.stat.topicstat import TopicStat
|
||||
from services.stat.views import Stat
|
||||
from services.stat.views import ViewStat
|
||||
|
||||
|
||||
async def get_topic_stat(slug):
|
||||
@@ -17,7 +17,7 @@ async def get_topic_stat(slug):
|
||||
"shouts": len(TopicStat.shouts_by_topic.get(slug, {}).keys()),
|
||||
"authors": len(TopicStat.authors_by_topic.get(slug, {}).keys()),
|
||||
"followers": len(TopicStat.followers_by_topic.get(slug, {}).keys()),
|
||||
"viewed": await Stat.get_topic(slug),
|
||||
"viewed": await ViewStat.get_topic(slug),
|
||||
"reacted": len(await ReactedStorage.get_topic(slug)),
|
||||
"commented": len(await ReactedStorage.get_topic_comments(slug)),
|
||||
"rating": await ReactedStorage.get_topic_rating(slug)
|
||||
|
@@ -67,7 +67,7 @@ async def load_shouts_by(_, info, by, amount=50, offset=0):
|
||||
q = q.group_by(Shout.id, Reaction.id).order_by(
|
||||
desc(by.get("order") or "createdAt")
|
||||
).limit(amount).offset(offset)
|
||||
|
||||
print(q)
|
||||
shouts = []
|
||||
with local_session() as session:
|
||||
# post query stats and author's captions
|
||||
|
Reference in New Issue
Block a user