Spaces:
Sleeping
Sleeping
Download src/models/session.py from hashir-qt/tasklert-api: direct link, hf CLI and curl.
- Browser
- Download file 911 Bytes
-
https://huggingface.co/spaces/hashir-qt/tasklert-api/resolve/main/src/models/session.py
- Command line
-
hf download hf://spaces/hashir-qt/tasklert-api/src/models/session.py
-
curl -L -o session.py https://huggingface.co/spaces/hashir-qt/tasklert-api/resolve/main/src/models/session.py
911 Bytes
| """Better Auth Session model for database queries.""" | |
| from datetime import datetime | |
| from sqlmodel import Field, SQLModel, Relationship | |
| from typing import Optional | |
| class Session(SQLModel, table=True): | |
| """Better Auth Session model.""" | |
| __tablename__ = "session" | |
| id: str = Field(primary_key=True) | |
| expires_at: datetime = Field(sa_column_kwargs={"name": "expiresAt"}) | |
| token: str = Field(unique=True, index=True) | |
| created_at: datetime = Field(default_factory=datetime.utcnow, sa_column_kwargs={"name": "createdAt"}) | |
| updated_at: datetime = Field(default_factory=datetime.utcnow, sa_column_kwargs={"name": "updatedAt"}) | |
| ip_address: Optional[str] = Field(default=None, sa_column_kwargs={"name": "ipAddress"}) | |
| user_agent: Optional[str] = Field(default=None, sa_column_kwargs={"name": "userAgent"}) | |
| user_id: str = Field(foreign_key="user.id", sa_column_kwargs={"name": "userId"}) | |