Skip to content

Instantly share code, notes, and snippets.

@Joaopcamposs
Created May 10, 2022 15:50
Show Gist options
  • Save Joaopcamposs/07ce488203383f6c8171a53b6cbdc35a to your computer and use it in GitHub Desktop.
Save Joaopcamposs/07ce488203383f6c8171a53b6cbdc35a to your computer and use it in GitHub Desktop.
# schemas.py
from pydantic import BaseModel
# To support creation and update APIs
class CreateAndUpdateUser(BaseModel):
name: str
email: str
password: str
# To support list and get APIs
class Users(CreateAndUpdateUser):
id: int
class Config:
orm_mode = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment