Spaces:
Running
Running
Download backend/app/models/system.py from axeronis/microfunnel-api: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/app/models/system.py
- Command line
-
hf download hf://spaces/axeronis/microfunnel-api/backend/app/models/system.py
-
curl -L -o system.py https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/app/models/system.py
1.15 kB
| from sqlmodel import SQLModel, Field | |
| from datetime import datetime | |
| from uuid import UUID, uuid4 | |
| from typing import Optional | |
| from sqlalchemy import Column, JSON | |
| class SystemAnnouncement(SQLModel, table=True): | |
| """ | |
| Global system announcements/banners. | |
| """ | |
| __tablename__ = "system_announcements" | |
| id: UUID = Field(default_factory=uuid4, primary_key=True) | |
| title: str | |
| message: str | |
| type: str = Field(default="info") # info, warning, error, success | |
| is_active: bool = Field(default=True) | |
| created_at: datetime = Field(default_factory=datetime.utcnow) | |
| expires_at: Optional[datetime] = None | |
| created_by: UUID = Field(default=None) # Admin ID | |
| class SiteSettings(SQLModel, table=True): | |
| """ | |
| Global site settings configurable by admin. | |
| """ | |
| __tablename__ = "site_settings" | |
| id: UUID = Field(default_factory=uuid4, primary_key=True) | |
| key: str = Field(unique=True, index=True) # e.g., "trust_logos", "footer_text" | |
| value: str = Field(default="") # JSON string for complex values | |
| updated_at: datetime = Field(default_factory=datetime.utcnow) | |
| updated_by: Optional[UUID] = None | |