2022-12-08 02:49:23 +03:00
|
|
|
|
from pydantic import EmailStr
|
|
|
|
|
from sqlalchemy import Boolean, Column, Integer, String
|
|
|
|
|
|
|
|
|
|
from med_backend.db.base import Base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserScheme(Base):
|
|
|
|
|
"""Class to store base info about users"""
|
|
|
|
|
|
|
|
|
|
__tablename__ = "users"
|
|
|
|
|
|
|
|
|
|
id: int = Column(Integer, primary_key=True, index=True)
|
2022-12-08 03:27:15 +03:00
|
|
|
|
username: str = Column(String, unique=True, index=True, nullable=False)
|
|
|
|
|
email: EmailStr = Column(String, unique=True, index=True, nullable=False)
|
|
|
|
|
fullname: str = Column(String, default="")
|
2022-12-08 02:49:23 +03:00
|
|
|
|
hashed_password: str = Column(String)
|
2022-12-08 03:27:15 +03:00
|
|
|
|
gender: str = Column(String, default="Не выбран")
|
|
|
|
|
age: int = Column(Integer, default=0)
|
|
|
|
|
latest_form_result: str = Column(String, default="ok")
|
|
|
|
|
|
|
|
|
|
is_manager: bool = Column(Boolean, default=False)
|
2022-12-08 02:49:23 +03:00
|
|
|
|
disabled: bool = Column(Boolean, default=False)
|