minor style fixes

This commit is contained in:
Mouse Reeve
2020-10-16 19:13:18 -07:00
parent d1d339225c
commit 8cf7e4405d
6 changed files with 13 additions and 12 deletions

View File

@ -44,10 +44,9 @@ class ActivityObject:
type: str
def __init__(self, **kwargs):
''' this lets you pass in an object with fields
that aren't in the dataclass, which it ignores.
Any field in the dataclass is required or has a
default value '''
''' this lets you pass in an object with fields that aren't in the
dataclass, which it ignores. Any field in the dataclass is required or
has a default value '''
for field in fields(self):
try:
value = kwargs[field.name]
@ -59,7 +58,7 @@ class ActivityObject:
def to_model(self, model, instance=None):
''' convert from an activity to a model '''
''' convert from an activity to a model instance '''
if not isinstance(self, model.activity_serializer):
raise TypeError('Wrong activity type for model')

View File

@ -52,7 +52,6 @@ class Work(Book):
type: str = 'Work'
@dataclass(init=False)
class Author(ActivityObject):
''' author of a book '''

View File

@ -6,6 +6,7 @@ from .base_activity import ActivityObject, Image
@dataclass(init=False)
class Tombstone(ActivityObject):
''' the placeholder for a deleted status '''
url: str
published: str
deleted: str
@ -23,7 +24,6 @@ class Note(ActivityObject):
cc: List[str]
content: str
replies: Dict
# TODO: this is wrong???
attachment: List[Image] = field(default=lambda: [])
sensitive: bool = False
type: str = 'Note'