2024-03-12 01:06:43 +03:00
|
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
2024-03-04 07:12:29 +03:00
|
|
|
|
2024-03-11 21:07:01 +03:00
|
|
|
from . import Base
|
2024-03-04 07:12:29 +03:00
|
|
|
|
|
|
|
|
2024-03-11 21:07:01 +03:00
|
|
|
class UserModel(Base):
|
2024-03-04 07:12:29 +03:00
|
|
|
__tablename__ = "users"
|
|
|
|
|
2024-03-12 01:06:43 +03:00
|
|
|
first_name: Mapped[str]
|
|
|
|
mid_name: Mapped[str]
|
|
|
|
last_name: Mapped[str]
|
|
|
|
|
|
|
|
email: Mapped[str] = mapped_column(unique=True)
|
|
|
|
telegram_id: Mapped[str] = mapped_column(unique=True)
|
|
|
|
|
|
|
|
hashed_password: Mapped[str]
|
|
|
|
is_active: Mapped[bool] = mapped_column(default=False)
|
2024-03-04 07:12:29 +03:00
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return (
|
|
|
|
f"<User(id={self.id}, "
|
|
|
|
f'email="{self.email}", '
|
|
|
|
f'hashed_password="{self.hashed_password}", '
|
|
|
|
f"is_active={self.is_active})>"
|
|
|
|
)
|