mirror of
https://github.com/wowlikon/LibraryAPI.git
synced 2025-12-11 21:30:46 +00:00
Форматирование кода, добавление лого, исправление тестов, улучшение эндпоинтов и документации
This commit is contained in:
@@ -2,24 +2,27 @@ from sqlmodel import SQLModel
|
||||
from pydantic import ConfigDict
|
||||
from typing import Optional, List
|
||||
|
||||
|
||||
class GenreBase(SQLModel):
|
||||
name: str
|
||||
|
||||
model_config = ConfigDict( #pyright: ignore
|
||||
json_schema_extra={
|
||||
"example": {"name": "genre_name"}
|
||||
}
|
||||
model_config = ConfigDict( # pyright: ignore
|
||||
json_schema_extra={"example": {"name": "genre_name"}}
|
||||
)
|
||||
|
||||
|
||||
class GenreCreate(GenreBase):
|
||||
pass
|
||||
|
||||
|
||||
class GenreUpdate(SQLModel):
|
||||
name: Optional[str] = None
|
||||
|
||||
|
||||
class GenreRead(GenreBase):
|
||||
id: int
|
||||
|
||||
|
||||
class GenreList(SQLModel):
|
||||
genres: List[GenreRead]
|
||||
total: int
|
||||
|
||||
Reference in New Issue
Block a user