mirror of
https://github.com/wowlikon/LiB.git
synced 2026-02-04 04:31:09 +00:00
Global refactoring of the project to use poetry and implement tests,
fixing bugs, changing the handling of dto and db models, preparing to add new functionality
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from sqlmodel import SQLModel
|
||||
from pydantic import ConfigDict
|
||||
from typing import Optional, List
|
||||
|
||||
class AuthorBase(SQLModel):
|
||||
name: str
|
||||
|
||||
model_config = ConfigDict( #pyright: ignore
|
||||
json_schema_extra={
|
||||
"example": {"name": "author_name"}
|
||||
}
|
||||
)
|
||||
|
||||
class AuthorCreate(AuthorBase):
|
||||
pass
|
||||
|
||||
class AuthorUpdate(SQLModel):
|
||||
name: Optional[str] = None
|
||||
|
||||
class AuthorRead(AuthorBase):
|
||||
id: int
|
||||
|
||||
class AuthorList(SQLModel):
|
||||
authors: List[AuthorRead]
|
||||
total: int
|
||||
Reference in New Issue
Block a user