Spaces:
Running on T4
Running on T4
Download backend/app/modules/devices/models.py from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 817 Bytes
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/devices/models.py
- Command line
-
hf download hf://spaces/modventures/baseball-engine/backend/app/modules/devices/models.py
-
curl -L -o models.py https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/devices/models.py
817 Bytes
| import uuid | |
| from datetime import datetime | |
| from sqlalchemy import CheckConstraint, DateTime, ForeignKey, String, Text, func | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| from app.common.base_model import Base, CreatedAtMixin, IdMixin | |
| class Device(IdMixin, CreatedAtMixin, Base): | |
| __tablename__ = "devices" | |
| __table_args__ = (CheckConstraint("platform IN ('ios', 'android')", name="platform"),) | |
| account_id: Mapped[uuid.UUID] = mapped_column( | |
| UUID(as_uuid=True), ForeignKey("accounts.id", ondelete="CASCADE"), index=True | |
| ) | |
| platform: Mapped[str] = mapped_column(String(8)) | |
| push_token: Mapped[str] = mapped_column(Text, unique=True) | |
| last_seen_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now()) | |