edh-elo/app/sql/schemas.py
2024-01-31 20:46:04 -08:00

33 lines
453 B
Python

from typing import Optional
from pydantic import BaseModel
class PlayerBase(BaseModel):
name: str
class PlayerCreate(PlayerBase):
pass
class Player(PlayerBase):
id: int
model_config = {"from_attributes": True}
class DeckBase(BaseModel):
name: str
description: Optional[str] = None
owner_id: int
class DeckCreate(DeckBase):
pass
class Deck(DeckBase):
id: int
model_config = {"from_attributes": True}