Spaces:
Running on T4
Running on T4
Download backend/app/modules/teams/models.py from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 780 Bytes
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/teams/models.py
- Command line
-
hf download hf://spaces/modventures/baseball-engine/backend/app/modules/teams/models.py
-
curl -L -o models.py https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/teams/models.py
780 Bytes
| import uuid | |
| from sqlalchemy import CheckConstraint, ForeignKey, String | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| from app.common.base_model import Base, IdMixin, TimestampMixin | |
| class Team(IdMixin, TimestampMixin, Base): | |
| """One team per coach. The coach's display name is accounts.name.""" | |
| __tablename__ = "teams" | |
| __table_args__ = (CheckConstraint("coaching IN ('h', 'p', 'both')", name="coaching"),) | |
| code: Mapped[str] = mapped_column(String(8), unique=True) | |
| name: Mapped[str] = mapped_column(String(60)) | |
| coach_id: Mapped[uuid.UUID] = mapped_column( | |
| UUID(as_uuid=True), ForeignKey("accounts.id", ondelete="CASCADE"), unique=True | |
| ) | |
| coaching: Mapped[str] = mapped_column(String(4)) | |