nodict
This commit is contained in:
parent
368b7e6c5a
commit
364fdd1cd6
|
@ -61,7 +61,7 @@ class Shout(Base):
|
||||||
oid: str = Column(String, nullable=True)
|
oid: str = Column(String, nullable=True)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
async def stat(self) -> Dict:
|
async def stat(self):
|
||||||
return {
|
return {
|
||||||
"viewed": await ViewedStorage.get_shout(self.slug),
|
"viewed": await ViewedStorage.get_shout(self.slug),
|
||||||
"reacted": await ReactionsStorage.by_shout(self.slug)
|
"reacted": await ReactionsStorage.by_shout(self.slug)
|
||||||
|
|
|
@ -55,7 +55,7 @@ class TopicStat:
|
||||||
return self.shouts_by_topic.get(topic, [])
|
return self.shouts_by_topic.get(topic, [])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def get_stat(topic) -> Dict:
|
async def get_stat(topic):
|
||||||
self = TopicStat
|
self = TopicStat
|
||||||
async with self.lock:
|
async with self.lock:
|
||||||
shouts = self.shouts_by_topic.get(topic, [])
|
shouts = self.shouts_by_topic.get(topic, [])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user