Add Division info to Teams
This commit is contained in:
@@ -14,6 +14,7 @@ from .base import (
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .event import Event
|
||||
from .division import DivisionTeamLink
|
||||
|
||||
# region # Team ################################################################
|
||||
|
||||
@@ -28,9 +29,6 @@ class TeamBase(
|
||||
event_id: RowId = Field(
|
||||
foreign_key="event.id", nullable=False, ondelete="CASCADE"
|
||||
)
|
||||
# scouting_team_id: RowId | None = Field(
|
||||
# foreign_key="ScoutingTeam.id", nullable=False, ondelete="CASCADE"
|
||||
# )
|
||||
|
||||
|
||||
# Properties to receive via API on creation
|
||||
@@ -49,8 +47,8 @@ class Team(mixin.RowId, TeamBase, table=True):
|
||||
# --- read only items ------------------------------------------------------
|
||||
|
||||
# --- back_populates links -------------------------------------------------
|
||||
event: "Event" = Relationship(back_populates="team_links")#, cascade_delete=True)
|
||||
# team: "ScoutingTeam" = Relationship(back_populates="event_links", cascade_delete=True)
|
||||
event: "Event" = Relationship(back_populates="teams")
|
||||
division_link: "DivisionTeamLink" = Relationship(back_populates="team", cascade_delete=True)
|
||||
|
||||
# --- CRUD actions ---------------------------------------------------------
|
||||
@classmethod
|
||||
@@ -85,4 +83,4 @@ class TeamsPublic(BaseSQLModel):
|
||||
count: int
|
||||
|
||||
|
||||
# endregion
|
||||
# endregion
|
||||
|
||||
Reference in New Issue
Block a user