Spaces:
Running on Zero
Running on Zero
Download app/db/models/user.py from cipher-attacks/Dbu-central-bot: direct link, hf CLI and curl.
- Browser
- Download file 2.3 kB
-
https://huggingface.co/spaces/cipher-attacks/Dbu-central-bot/resolve/main/app/db/models/user.py
- Command line
-
hf download hf://spaces/cipher-attacks/Dbu-central-bot/app/db/models/user.py
-
curl -L -o user.py https://huggingface.co/spaces/cipher-attacks/Dbu-central-bot/resolve/main/app/db/models/user.py
2.3 kB
| from datetime import date, datetime | |
| from typing import Optional | |
| from sqlalchemy import BigInteger, Boolean, Date, DateTime, Integer, String, func | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| from app.db.base import Base | |
| class User(Base): | |
| __tablename__ = "users" | |
| id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=False) | |
| username: Mapped[Optional[str]] = mapped_column(String(64)) | |
| full_name: Mapped[str] = mapped_column(String(256), default="") | |
| lang: Mapped[str] = mapped_column(String(2), default="am") | |
| stream: Mapped[Optional[str]] = mapped_column(String(16)) | |
| year: Mapped[Optional[int]] = mapped_column(Integer) | |
| referred_by: Mapped[Optional[int]] = mapped_column(BigInteger) | |
| gate_passed: Mapped[bool] = mapped_column(Boolean, default=False) | |
| points: Mapped[int] = mapped_column(Integer, default=0) | |
| streak: Mapped[int] = mapped_column(Integer, default=0, server_default="0") | |
| best_streak: Mapped[int] = mapped_column(Integer, default=0, server_default="0") | |
| last_active_on: Mapped[Optional[date]] = mapped_column(Date) | |
| active_days: Mapped[int] = mapped_column(Integer, default=0, server_default="0") | |
| week_key: Mapped[Optional[str]] = mapped_column(String(8)) | |
| week_xp: Mapped[int] = mapped_column(Integer, default=0, server_default="0") | |
| day_key: Mapped[Optional[str]] = mapped_column(String(10)) | |
| day_xp: Mapped[int] = mapped_column(Integer, default=0, server_default="0") | |
| trust: Mapped[int] = mapped_column(Integer, default=100, server_default="100") | |
| source: Mapped[Optional[str]] = mapped_column(String(24)) # where they came from (poster, inline, referral...) | |
| pending_link: Mapped[Optional[str]] = mapped_column(String(16)) # deep link to open after joining/onboarding | |
| share_prompt_day: Mapped[Optional[str]] = mapped_column(String(10)) # last day we suggested sharing | |
| credit_name: Mapped[bool] = mapped_column(Boolean, default=False, server_default="false") # name on files they give | |
| gate_missing: Mapped[Optional[str]] = mapped_column(String(80)) # which join-gate places they were last missing | |
| is_banned: Mapped[bool] = mapped_column(Boolean, default=False) | |
| created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now()) | |