19 lines
547 B
Python
19 lines
547 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from fooder.domain.base import Base, CommonMixin, PasswordMixin, SoftDeleteMixin
|
|
|
|
if TYPE_CHECKING:
|
|
from fooder.domain.user_settings import UserSettings
|
|
|
|
|
|
class User(Base, CommonMixin, PasswordMixin, SoftDeleteMixin):
|
|
"""User."""
|
|
|
|
username: Mapped[str] = mapped_column(unique=True)
|
|
settings: Mapped[UserSettings] = relationship(
|
|
back_populates="user", lazy="selectin", uselist=False
|
|
)
|