26 lines
636 B
Python
26 lines
636 B
Python
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from . import Base
|
|
|
|
|
|
class UserModel(Base):
|
|
__tablename__ = "users"
|
|
|
|
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)
|
|
|
|
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})>"
|
|
)
|