Spaces:
Paused
Paused
Download models/notification.py from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 943 Bytes
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/models/notification.py
- Command line
-
hf download hf://spaces/3SCError404/nexus/models/notification.py
-
curl -L -o notification.py https://huggingface.co/spaces/3SCError404/nexus/resolve/main/models/notification.py
943 Bytes
| """ | |
| Notification model for in-app alerts. | |
| """ | |
| from sqlalchemy import Column, String, Boolean, ForeignKey, DateTime, Text | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from datetime import datetime | |
| import uuid | |
| from core.database import Base | |
| class Notification(Base): | |
| __tablename__ = "notifications" | |
| id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) | |
| workspace_id = Column(UUID(as_uuid=True), ForeignKey("workspaces.id"), nullable=False) | |
| user_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=False) | |
| title = Column(String(255), nullable=False) | |
| message = Column(Text, nullable=False) | |
| is_read = Column(Boolean, default=False) | |
| link = Column(String(512), nullable=True) # Optional URL/Route to navigate to | |
| created_at = Column( | |
| DateTime(timezone=False), | |
| default=datetime.utcnow, | |
| nullable=False | |
| ) | |
| deleted_at = Column(DateTime, nullable=True) | |