forked from mirrors/bookwyrm
Corrects activitypub fields to camelcase in Book
This commit is contained in:
parent
1df5b2d481
commit
69a6644011
2 changed files with 29 additions and 29 deletions
|
@ -7,23 +7,23 @@ from .base_activity import ActivityObject, Image
|
|||
@dataclass(init=False)
|
||||
class Book(ActivityObject):
|
||||
''' serializes an edition or work, abstract '''
|
||||
authors: List[str]
|
||||
first_published_date: str
|
||||
published_date: str
|
||||
|
||||
title: str
|
||||
sort_title: str
|
||||
subtitle: str
|
||||
description: str
|
||||
sortTitle: str = ''
|
||||
subtitle: str = ''
|
||||
description: str = ''
|
||||
languages: List[str]
|
||||
series: str
|
||||
series_number: str
|
||||
series: str = ''
|
||||
seriesNumber: str = ''
|
||||
subjects: List[str]
|
||||
subject_places: List[str]
|
||||
subjectPlaces: List[str]
|
||||
|
||||
openlibrary_key: str
|
||||
librarything_key: str
|
||||
goodreads_key: str
|
||||
authors: List[str]
|
||||
firstPublishedDate: str = ''
|
||||
publishedDate: str = ''
|
||||
|
||||
openlibraryKey: str = ''
|
||||
librarythingKey: str = ''
|
||||
goodreadsKey: str = ''
|
||||
|
||||
attachment: List[Image] = field(default_factory=lambda: [])
|
||||
type: str = 'Book'
|
||||
|
@ -32,12 +32,12 @@ class Book(ActivityObject):
|
|||
@dataclass(init=False)
|
||||
class Edition(Book):
|
||||
''' Edition instance of a book object '''
|
||||
isbn_10: str
|
||||
isbn_13: str
|
||||
oclc_number: str
|
||||
isbn10: str
|
||||
isbn13: str
|
||||
oclcNumber: str
|
||||
asin: str
|
||||
pages: str
|
||||
physical_format: str
|
||||
physicalFormat: str
|
||||
publishers: List[str]
|
||||
|
||||
work: str
|
||||
|
|
|
@ -70,30 +70,30 @@ class Book(ActivitypubMixin, BookWyrmModel):
|
|||
ActivityMapping('id', 'remote_id'),
|
||||
|
||||
ActivityMapping('authors', 'ap_authors'),
|
||||
ActivityMapping('first_published_date', 'first_published_date'),
|
||||
ActivityMapping('published_date', 'published_date'),
|
||||
ActivityMapping('firstPublishedDate', 'firstpublished_date'),
|
||||
ActivityMapping('publishedDate', 'published_date'),
|
||||
|
||||
ActivityMapping('title', 'title'),
|
||||
ActivityMapping('sort_title', 'sort_title'),
|
||||
ActivityMapping('sortTitle', 'sort_title'),
|
||||
ActivityMapping('subtitle', 'subtitle'),
|
||||
ActivityMapping('description', 'description'),
|
||||
ActivityMapping('languages', 'languages'),
|
||||
ActivityMapping('series', 'series'),
|
||||
ActivityMapping('series_number', 'series_number'),
|
||||
ActivityMapping('seriesNumber', 'series_number'),
|
||||
ActivityMapping('subjects', 'subjects'),
|
||||
ActivityMapping('subject_places', 'subject_places'),
|
||||
ActivityMapping('subjectPlaces', 'subject_places'),
|
||||
|
||||
ActivityMapping('openlibrary_key', 'openlibrary_key'),
|
||||
ActivityMapping('librarything_key', 'librarything_key'),
|
||||
ActivityMapping('goodreads_key', 'goodreads_key'),
|
||||
ActivityMapping('openlibraryKey', 'openlibrary_key'),
|
||||
ActivityMapping('librarythingKey', 'librarything_key'),
|
||||
ActivityMapping('goodreadsKey', 'goodreads_key'),
|
||||
|
||||
ActivityMapping('work', 'ap_parent_work'),
|
||||
ActivityMapping('isbn_10', 'isbn_10'),
|
||||
ActivityMapping('isbn_13', 'isbn_13'),
|
||||
ActivityMapping('oclc_number', 'oclc_number'),
|
||||
ActivityMapping('isbn10', 'isbn_10'),
|
||||
ActivityMapping('isbn13', 'isbn_13'),
|
||||
ActivityMapping('oclcNumber', 'oclc_number'),
|
||||
ActivityMapping('asin', 'asin'),
|
||||
ActivityMapping('pages', 'pages'),
|
||||
ActivityMapping('physical_format', 'physical_format'),
|
||||
ActivityMapping('physicalFormat', 'physical_format'),
|
||||
ActivityMapping('publishers', 'publishers'),
|
||||
|
||||
ActivityMapping('lccn', 'lccn'),
|
||||
|
|
Loading…
Reference in a new issue