Refactoring

This commit is contained in:
2021-12-10 16:27:10 +03:00
parent e77366d9e9
commit 1baae19702
7 changed files with 37 additions and 181 deletions

View File

@@ -1,3 +1,5 @@
from typing import Optional
from datetime import date
from pydantic import BaseModel
from app.serializers.orjson_config import ORJSONConfig
@@ -18,3 +20,28 @@ class CreateSequence(BaseModel):
class Config(ORJSONConfig):
pass
class Author(BaseModel):
id: int
first_name: str
last_name: str
middle_name: Optional[str]
class Config(ORJSONConfig):
pass
class Book(BaseModel):
id: int
title: str
lang: str
file_type: str
available_types: list[str]
uploaded: date
authors: list[Author]
annotation_exists: bool
class Config(ORJSONConfig):
pass