Spaces:
Running
Running
Download app/models/team_procedure_value.py from yCamelow/docboard-api: direct link, hf CLI and curl.
- Browser
- Download file 925 Bytes
-
https://huggingface.co/spaces/yCamelow/docboard-api/resolve/main/app/models/team_procedure_value.py
- Command line
-
hf download hf://spaces/yCamelow/docboard-api/app/models/team_procedure_value.py
-
curl -L -o team_procedure_value.py https://huggingface.co/spaces/yCamelow/docboard-api/resolve/main/app/models/team_procedure_value.py
925 Bytes
| import uuid | |
| from decimal import Decimal | |
| from typing import Optional, TYPE_CHECKING | |
| from sqlmodel import Field, SQLModel, Relationship | |
| if TYPE_CHECKING: | |
| from .team import Team | |
| from .procedure_type import ProcedureType | |
| class TeamProcedureValue(SQLModel, table=True): | |
| """ | |
| Intermediate table between Team and ProcedureType. | |
| Holds the custom contract pricing and goals for a specific team. | |
| """ | |
| __tablename__ = "team_procedure_values" | |
| team_id: uuid.UUID = Field(foreign_key="teams.id", primary_key=True) | |
| procedure_type_id: int = Field(foreign_key="procedure_types.id", primary_key=True) | |
| custom_value: Decimal = Field(default=0, max_digits=10, decimal_places=2) | |
| custom_goal: Optional[int] = Field(default=None) | |
| # Relationships | |
| team: "Team" = Relationship(back_populates="procedure_values") | |
| procedure_type: "ProcedureType" = Relationship(back_populates="team_values") | |