mirror of
https://github.com/kevin-DL/fast_api_api_template.git
synced 2026-01-11 17:54:35 +00:00
Register
Login Basic migrations with alembic Get items
This commit is contained in:
0
schemas/__init__.py
Normal file
0
schemas/__init__.py
Normal file
20
schemas/items.py
Normal file
20
schemas/items.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import uuid
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ItemBase(BaseModel):
|
||||
title: str
|
||||
description: str | None = None
|
||||
|
||||
|
||||
class ItemCreate(ItemBase):
|
||||
pass
|
||||
|
||||
|
||||
class Item(ItemBase):
|
||||
id: uuid.UUID
|
||||
owner_id: uuid.UUID
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
23
schemas/users.py
Normal file
23
schemas/users.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import uuid
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from schemas.items import Item
|
||||
|
||||
|
||||
class UserBase(BaseModel):
|
||||
display_name: str
|
||||
|
||||
|
||||
class UserCreate(UserBase):
|
||||
password: str
|
||||
email: str
|
||||
|
||||
|
||||
class User(UserBase):
|
||||
id: uuid.UUID
|
||||
is_active: bool
|
||||
items: list[Item] = []
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
Reference in New Issue
Block a user