Cleaned up as_dict/asdict, issue #144, #188

This commit is contained in:
Rhet Turnbull
2020-10-27 06:54:42 -07:00
parent 091f1d9bb4
commit 603dabb8f4
12 changed files with 94 additions and 34 deletions

View File

@@ -1,6 +1,7 @@
""" PhotosDB method for processing comments and likes on shared photos.
Do not import this module directly """
import dataclasses
import datetime
from dataclasses import dataclass
@@ -30,6 +31,9 @@ class CommentInfo:
ismine: bool
text: str
def asdict(self):
return dataclasses.asdict(self)
@dataclass
class LikeInfo:
@@ -39,6 +43,9 @@ class LikeInfo:
user: str
ismine: bool
def asdict(self):
return dataclasses.asdict(self)
# The following methods do not get imported into PhotosDB
# but will get called by _process_comments