service_man/api/models/refers_model.py

19 lines
443 B
Python
Raw Normal View History

2024-03-29 00:29:35 +03:00
from uuid import UUID
from sqlalchemy import ForeignKey
from sqlalchemy.orm import Mapped, mapped_column, relationship
from api.models import BaseModel
class RefersModel(BaseModel):
__tablename__ = "refers"
referer: Mapped[UUID] = mapped_column(ForeignKey("user.id"))
referals: Mapped[list["UserModel"]] = relationship(
"UserModel",
backref="refers",
lazy="selectin",
)
is_active: Mapped[bool]