File size: 583 Bytes
29cbab9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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")