backend/med_backend/db/models/users.py
2022-12-09 02:33:22 +03:00

30 lines
841 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from datetime import date
from pydantic import EmailStr
from sqlalchemy import Boolean, Column, Date, 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,
autoincrement=True,
unique=True,
index=True,
)
email: EmailStr = Column(String, unique=True, index=True, nullable=False)
fullname: str = Column(String, default="")
hashed_password: str = Column(String)
gender: str = Column(String, default="Не выбран")
born: date = Column(Date, nullable=False)
latest_form_result: str = Column(String, default="ok")
is_manager: bool = Column(Boolean, default=False)
disabled: bool = Column(Boolean, default=False)