fixes-refactoring-and-views

This commit is contained in:
2022-11-15 15:04:22 +03:00
parent f089d4903b
commit e52a51fc13
9 changed files with 44 additions and 26 deletions

View File

@@ -2,7 +2,7 @@ import asyncio
from base.orm import local_session
from orm.reaction import ReactionKind, Reaction
from services.zine.topics import TopicStorage
from services.stat.views import Stat
from services.stat.views import ViewStat
def kind_to_rate(kind) -> int:
@@ -36,7 +36,7 @@ class ReactedStorage:
@staticmethod
async def get_shout_stat(slug):
return {
"viewed": await Stat.get_shout(slug),
"viewed": await ViewStat.get_shout(slug),
"reacted": len(await ReactedStorage.get_shout(slug)),
"commented": len(await ReactedStorage.get_comments(slug)),
"rating": await ReactedStorage.get_rating(slug),