Spaces:
Running
Running
| import uuid | |
| from typing import List, Optional, TYPE_CHECKING | |
| from sqlmodel import Field, SQLModel, Relationship | |
| if TYPE_CHECKING: | |
| from .team import Team | |
| class Institution(SQLModel, table=True): | |
| """ | |
| Represents a physical hospital or institution. | |
| """ | |
| __tablename__ = "institutions" | |
| id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True) | |
| name: str = Field(nullable=False) | |
| city: str = Field(nullable=False) | |
| state: str = Field(nullable=False) | |
| # Relationships | |
| teams: List["Team"] = Relationship(back_populates="institution") | |