Use CollectionItem objects

This commit is contained in:
Mouse Reeve
2021-04-08 14:16:34 -07:00
parent 6617cede37
commit 98161b9041
3 changed files with 29 additions and 8 deletions

View File

@ -50,3 +50,27 @@ class OrderedCollectionPage(ActivityObject):
next: str = None
prev: str = None
type: str = "OrderedCollectionPage"
@dataclass(init=False)
class CollectionItem(ActivityObject):
""" an item in a collection """
actor: str
type: str = "CollectionItem"
@dataclass(init=False)
class ListItem(CollectionItem):
""" a book on a list """
book: str
notes: str = None
approved: bool = True
order: int = None
type: str = "ListItem"
@dataclass(init=False)
class ShelfItem(CollectionItem):
""" a book on a list """
book: str
type: str = "ShelfItem"