Download src/models/team.py from arimatch1/crewhub: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/arimatch1/crewhub/resolve/main/src/models/team.py
- Command line
-
hf download hf://spaces/arimatch1/crewhub/src/models/team.py
-
curl -L -o team.py https://huggingface.co/spaces/arimatch1/crewhub/resolve/main/src/models/team.py
1.16 kB
| # Copyright (c) 2026 CrewHub. All rights reserved. | |
| # Proprietary and confidential. See LICENSE for details. | |
| """Team model — groups within an organization.""" | |
| import uuid | |
| from datetime import datetime | |
| from sqlalchemy import DateTime, ForeignKey, String, Text, Uuid, func | |
| from sqlalchemy.orm import Mapped, mapped_column, relationship | |
| from src.database import Base | |
| class Team(Base): | |
| __tablename__ = "teams" | |
| id: Mapped[uuid.UUID] = mapped_column( | |
| Uuid, primary_key=True, default=uuid.uuid4 | |
| ) | |
| organization_id: Mapped[uuid.UUID] = mapped_column( | |
| Uuid, ForeignKey("organizations.id", ondelete="CASCADE"), nullable=False, index=True | |
| ) | |
| name: Mapped[str] = mapped_column(String(255), nullable=False) | |
| description: Mapped[str | None] = mapped_column(Text, nullable=True) | |
| created_at: Mapped[datetime] = mapped_column( | |
| DateTime(timezone=True), server_default=func.now(), nullable=False | |
| ) | |
| # Relationships | |
| organization: Mapped["Organization"] = relationship( | |
| "Organization", back_populates="teams" | |
| ) | |
| def __repr__(self) -> str: | |
| return f"<Team(id={self.id}, name={self.name})>" | |