17 lines
No EOL
479 B
Python
17 lines
No EOL
479 B
Python
from sqlmodel import SQLModel, Field, Relationship
|
|
from src.classes.play_classes import PlayPlayer, PlayPlayerPublicNoPlayer
|
|
|
|
class PlayerBase(SQLModel):
|
|
name: str
|
|
|
|
class Player(PlayerBase, table=True):
|
|
name: str | None = Field(default=None, primary_key=True)
|
|
|
|
playplayers: list[PlayPlayer] = Relationship(back_populates="player")
|
|
|
|
|
|
class PlayerPublic(PlayerBase):
|
|
playplayers: list[PlayPlayerPublicNoPlayer]
|
|
|
|
class PlayerPublicNoPlayPlayers(PlayerBase):
|
|
pass |