Skip to content

Instantly share code, notes, and snippets.

@gabbyprecious
Last active May 25, 2020 19:40
Show Gist options
  • Save gabbyprecious/8ba9dd7c2844902dde60c17ba840c282 to your computer and use it in GitHub Desktop.
Save gabbyprecious/8ba9dd7c2844902dde60c17ba840c282 to your computer and use it in GitHub Desktop.
from pydantic import BaseModel
class UserBase(BaseModel):
username: str
class UserCreate(UserBase):
first_name: str
last_name: str
email: str
password: str
class User(UserBase):
id: int
password: str
class Config:
orm_mode = True
#We edited from here
class FollowerBase(BaseModel):
userId: int
FollowerId: int
class FollowerCreate(FollowerBase):
pass
class Follower(FollowerBase):
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