Fixes search data and new activitypub fields
This commit is contained in:
@ -7,7 +7,17 @@ from .image import Image
|
||||
|
||||
|
||||
@dataclass(init=False)
|
||||
class Book(ActivityObject):
|
||||
class BookData(ActivityObject):
|
||||
""" shared fields for all book data and authors"""
|
||||
openlibraryKey: str = None
|
||||
inventaireId: str = None
|
||||
librarythingKey: str = None
|
||||
goodreadsKey: str = None
|
||||
bnfId: str = None
|
||||
|
||||
|
||||
@dataclass(init=False)
|
||||
class Book(BookData):
|
||||
""" serializes an edition or work, abstract """
|
||||
|
||||
title: str
|
||||
@ -24,11 +34,6 @@ class Book(ActivityObject):
|
||||
firstPublishedDate: str = ""
|
||||
publishedDate: str = ""
|
||||
|
||||
openlibraryKey: str = None
|
||||
inventaireId: str = None
|
||||
librarythingKey: str = None
|
||||
goodreadsKey: str = None
|
||||
|
||||
cover: Image = None
|
||||
type: str = "Book"
|
||||
|
||||
@ -61,17 +66,16 @@ class Work(Book):
|
||||
|
||||
|
||||
@dataclass(init=False)
|
||||
class Author(ActivityObject):
|
||||
class Author(BookData):
|
||||
""" author of a book """
|
||||
|
||||
name: str
|
||||
isni: str = None
|
||||
viafId: str = None
|
||||
gutenbergId: str = None
|
||||
born: str = None
|
||||
died: str = None
|
||||
aliases: List[str] = field(default_factory=lambda: [])
|
||||
bio: str = ""
|
||||
openlibraryKey: str = None
|
||||
inventaireId: str = None
|
||||
librarythingKey: str = None
|
||||
goodreadsKey: str = None
|
||||
wikipediaLink: str = ""
|
||||
type: str = "Author"
|
||||
|
Reference in New Issue
Block a user