WMGZON/controllers/database/user.py

33 lines
761 B
Python

from .database import DatabaseController
from models.users.user import User
class UserController(DatabaseController):
def __init__(self):
super().__init__()
def create(self, user: User):
params = [
user.firstName,
user.lastName,
user.email,
user.phone,
user.password,
user.role
]
self._conn.execute(
"INSERT INTO Users (first_name, last_name, email, phone, password, role) VALUES (?, ?, ?, ?, ?, ?)",
params
)
self._conn.commit()
user.login()
def read(self):
print("Doing work")
def update(self):
print("Doing work")
def delete(self):
print("Doing work")