From 400f33a7955498ea8dd1df9ab8453d317922c47d Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sat, 11 May 2024 14:51:34 +0700 Subject: [PATCH] Create user.py --- app/models/user.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/models/user.py diff --git a/app/models/user.py b/app/models/user.py new file mode 100644 index 0000000..e413270 --- /dev/null +++ b/app/models/user.py @@ -0,0 +1,17 @@ +# User model +from sqlalchemy import Column, Integer, String +from sqlalchemy.ext.declarative import declarative_base + +Base = declarative_base() + +class User(Base): + __tablename__ = 'users' + id = Column(Integer, primary_key=True) + username = Column(String, unique=True) + password = Column(String) + email = Column(String, unique=True) + + def __init__(self, username, password, email): + self.username = username + self.password = password + self.email = email