🔥 Remove unused schemas (#656)
This commit is contained in:
@@ -1,4 +0,0 @@
|
|||||||
from .item import Item, ItemCreate, ItemInDB, ItemUpdate
|
|
||||||
from .msg import Msg
|
|
||||||
from .token import Token, TokenPayload
|
|
||||||
from .user import User, UserCreate, UserInDB, UserUpdate
|
|
@@ -1,35 +0,0 @@
|
|||||||
from pydantic import BaseModel, ConfigDict
|
|
||||||
|
|
||||||
|
|
||||||
# Shared properties
|
|
||||||
class ItemBase(BaseModel):
|
|
||||||
title: str | None = None
|
|
||||||
description: str | None = None
|
|
||||||
|
|
||||||
|
|
||||||
# Properties to receive on item creation
|
|
||||||
class ItemCreate(ItemBase):
|
|
||||||
title: str
|
|
||||||
|
|
||||||
|
|
||||||
# Properties to receive on item update
|
|
||||||
class ItemUpdate(ItemBase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# Properties shared by models stored in DB
|
|
||||||
class ItemInDBBase(ItemBase):
|
|
||||||
id: int
|
|
||||||
title: str
|
|
||||||
owner_id: int
|
|
||||||
model_config = ConfigDict(from_attributes=True)
|
|
||||||
|
|
||||||
|
|
||||||
# Properties to return to client
|
|
||||||
class Item(ItemInDBBase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# Properties properties stored in DB
|
|
||||||
class ItemInDB(ItemInDBBase):
|
|
||||||
pass
|
|
@@ -1,5 +0,0 @@
|
|||||||
from pydantic import BaseModel
|
|
||||||
|
|
||||||
|
|
||||||
class Msg(BaseModel):
|
|
||||||
msg: str
|
|
@@ -1,10 +0,0 @@
|
|||||||
from pydantic import BaseModel
|
|
||||||
|
|
||||||
|
|
||||||
class Token(BaseModel):
|
|
||||||
access_token: str
|
|
||||||
token_type: str
|
|
||||||
|
|
||||||
|
|
||||||
class TokenPayload(BaseModel):
|
|
||||||
sub: int | None = None
|
|
@@ -1,35 +0,0 @@
|
|||||||
from pydantic import BaseModel, ConfigDict, EmailStr
|
|
||||||
|
|
||||||
|
|
||||||
# Shared properties
|
|
||||||
class UserBase(BaseModel):
|
|
||||||
email: EmailStr | None = None
|
|
||||||
is_active: bool | None = True
|
|
||||||
is_superuser: bool = False
|
|
||||||
full_name: str | None = None
|
|
||||||
|
|
||||||
|
|
||||||
# Properties to receive via API on creation
|
|
||||||
class UserCreate(UserBase):
|
|
||||||
email: EmailStr
|
|
||||||
password: str
|
|
||||||
|
|
||||||
|
|
||||||
# Properties to receive via API on update
|
|
||||||
class UserUpdate(UserBase):
|
|
||||||
password: str | None = None
|
|
||||||
|
|
||||||
|
|
||||||
class UserInDBBase(UserBase):
|
|
||||||
id: int | None = None
|
|
||||||
model_config = ConfigDict(from_attributes=True)
|
|
||||||
|
|
||||||
|
|
||||||
# Additional properties to return via API
|
|
||||||
class User(UserInDBBase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# Additional properties stored in DB
|
|
||||||
class UserInDB(UserInDBBase):
|
|
||||||
hashed_password: str
|
|
Reference in New Issue
Block a user