feat: deal tags
This commit is contained in:
@ -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",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user