Spaces:
Paused
Paused
Download models/workspace.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 949 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/workspace.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/models/workspace.py
-
curl -L -o workspace.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/workspace.py
949 Bytes
| """ | |
| Workspace model — multi-customer isolation. | |
| Each customer organization gets a separate workspace. | |
| """ | |
| from sqlalchemy import Column, String | |
| from sqlalchemy.dialects.postgresql import JSONB | |
| from sqlalchemy.orm import relationship | |
| from core.database import Base | |
| from models.base import PrimaryKeyMixin, TimestampMixin, SoftDeleteMixin | |
| class Workspace(Base, PrimaryKeyMixin, TimestampMixin, SoftDeleteMixin): | |
| __tablename__ = "workspaces" | |
| name = Column(String(255), nullable=False) | |
| branding = Column(JSONB, default={}, doc="Logo URL, primary/secondary colors") | |
| # Relationships | |
| users = relationship("User", back_populates="workspace", lazy="selectin") | |
| user_links = relationship("UserWorkspace", back_populates="workspace", cascade="all, delete-orphan") | |
| tickets = relationship("Ticket", back_populates="workspace", lazy="selectin") | |
| projects = relationship("Project", back_populates="workspace", lazy="selectin") | |