Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /ParisNeo_lollms /backend /db /models /fun_fact.py
| # backend/db/models/fun_fact.py | |
| from sqlalchemy import ( | |
| Column, Integer, String, Boolean, | |
| ForeignKey, Text | |
| ) | |
| from sqlalchemy.orm import relationship | |
| from backend.db.base import Base | |
| class FunFactCategory(Base): | |
| __tablename__ = "fun_fact_categories" | |
| id = Column(Integer, primary_key=True, index=True) | |
| name = Column(String, unique=True, nullable=False, index=True) | |
| is_active = Column(Boolean, default=True, nullable=False, index=True) | |
| color = Column(String(7), default="#4299e1", nullable=False) # e.g., #RRGGBB | |
| fun_facts = relationship("FunFact", back_populates="category", cascade="all, delete-orphan") | |
| class FunFact(Base): | |
| __tablename__ = "fun_facts" | |
| id = Column(Integer, primary_key=True, index=True) | |
| content = Column(Text, nullable=False) | |
| category_id = Column(Integer, ForeignKey("fun_fact_categories.id"), nullable=False, index=True) | |
| category = relationship("FunFactCategory", back_populates="fun_facts") |
Xet Storage Details
- Size:
- 974 Bytes
- Xet hash:
- 53a78e2e2f6d95f8185d4e9f6a42b75c22891ad632536222f8e5bc7c5a656018
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.