mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Use orjson in serializers
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.serializers.orjson_config import ORJSONConfig
|
||||
|
||||
|
||||
class TranslationBook(BaseModel):
|
||||
id: int
|
||||
@@ -7,6 +9,9 @@ class TranslationBook(BaseModel):
|
||||
lang: str
|
||||
file_type: str
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class TranslationTranslator(BaseModel):
|
||||
id: int
|
||||
@@ -14,21 +19,33 @@ class TranslationTranslator(BaseModel):
|
||||
last_name: str
|
||||
middle_name: str
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class Translation(BaseModel):
|
||||
book: TranslationBook
|
||||
translator: TranslationTranslator
|
||||
position: int
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class CreateTranslation(BaseModel):
|
||||
book: int
|
||||
translator: int
|
||||
position: int
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class CreateRemoteTranslation(BaseModel):
|
||||
source: int
|
||||
remote_book: int
|
||||
remote_translator: int
|
||||
position: int
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user