Skip to content

Commit

Permalink
Add User model to main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sahi-mfg committed Feb 1, 2024
1 parent 5d9862e commit b257b52
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from passlib.context import CryptContext # type: ignore
from PIL import Image
from pydantic import BaseModel
from sqlalchemy import Column, Integer, String # type: ignore
from sqlalchemy.ext.declarative import declarative_base # type: ignore

from .model import load_model, predict, prepare_image

Expand All @@ -24,16 +26,22 @@
ACCESS_TOKEN_EXPIRE_MINUTES = os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES")


Base = declarative_base()


class User(Base):
__tablename__ = "users"

id = Column(Integer, primary_key=True, index=True)
username = Column(String, unique=True, index=True)
hashed_password = Column(String)


class Token(BaseModel):
access_token: str
token_type: str


class User(BaseModel):
username: str
password: str


class UserInDB(User):
hashed_password: str

Expand Down

0 comments on commit b257b52

Please sign in to comment.