Browse Source

🔥 Remove unused schemas (#656)

pull/13907/head
Alejandra 1 year ago
committed by GitHub
parent
commit
7f87c0f5d5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      backend/app/schemas/__init__.py
  2. 35
      backend/app/schemas/item.py
  3. 5
      backend/app/schemas/msg.py
  4. 10
      backend/app/schemas/token.py
  5. 35
      backend/app/schemas/user.py

4
backend/app/schemas/__init__.py

@ -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

35
backend/app/schemas/item.py

@ -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

5
backend/app/schemas/msg.py

@ -1,5 +0,0 @@
from pydantic import BaseModel
class Msg(BaseModel):
msg: str

10
backend/app/schemas/token.py

@ -1,10 +0,0 @@
from pydantic import BaseModel
class Token(BaseModel):
access_token: str
token_type: str
class TokenPayload(BaseModel):
sub: int | None = None

35
backend/app/schemas/user.py

@ -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
Loading…
Cancel
Save