feat: deal tags

This commit is contained in:
2025-10-19 12:12:08 +04:00
parent d7c7d1775f
commit ffee658349
16 changed files with 355 additions and 8 deletions

View File

@ -6,7 +6,7 @@ from models.base import BaseModel
from models.mixins import SoftDeleteMixin, CreatedAtMixin, IdMixin
if TYPE_CHECKING:
from models import Board, BuiltInModule
from models import Board, BuiltInModule, DealTag
class Project(BaseModel, IdMixin, SoftDeleteMixin, CreatedAtMixin):
@ -25,3 +25,10 @@ class Project(BaseModel, IdMixin, SoftDeleteMixin, CreatedAtMixin):
lazy="selectin",
order_by="asc(BuiltInModule.id)",
)
tags: Mapped[list["DealTag"]] = relationship(
back_populates="project",
primaryjoin="and_(Project.id == DealTag.project_id, DealTag.is_deleted == False)",
order_by="asc(DealTag.id)",
lazy="selectin",
)