mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Init
This commit is contained in:
48
fastapi_book_server/app/serializers/author.py
Normal file
48
fastapi_book_server/app/serializers/author.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from typing import Optional
|
||||
from datetime import date
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Author(BaseModel):
|
||||
id: int
|
||||
|
||||
first_name: str
|
||||
last_name: str
|
||||
middle_name: Optional[str]
|
||||
|
||||
|
||||
class CreateAuthor(BaseModel):
|
||||
source: int
|
||||
remote_id: int
|
||||
|
||||
first_name: str
|
||||
last_name: str
|
||||
middle_name: Optional[str]
|
||||
|
||||
|
||||
class UpdateAuthor(BaseModel):
|
||||
first_name: str
|
||||
last_name: str
|
||||
middle_name: Optional[str]
|
||||
|
||||
|
||||
class AuthorBook(BaseModel):
|
||||
id: int
|
||||
title: str
|
||||
lang: str
|
||||
file_type: str
|
||||
|
||||
|
||||
class Translation(BaseModel):
|
||||
translator: Author
|
||||
position: int
|
||||
|
||||
|
||||
class TranslatedBook(BaseModel):
|
||||
id: int
|
||||
title: str
|
||||
lang: str
|
||||
file_type: str
|
||||
authors: list[Author]
|
||||
translations: list[Translation]
|
||||
Reference in New Issue
Block a user