Spaces:
Running
Running
Download app/models/chapter.py from AswinMathew/anime-gen-api: direct link, hf CLI and curl.
- Browser
- Download file 809 Bytes
-
https://huggingface.co/spaces/AswinMathew/anime-gen-api/resolve/main/app/models/chapter.py
- Command line
-
hf download hf://spaces/AswinMathew/anime-gen-api/app/models/chapter.py
-
curl -L -o chapter.py https://huggingface.co/spaces/AswinMathew/anime-gen-api/resolve/main/app/models/chapter.py
809 Bytes
| from sqlalchemy import Column, Integer, String, Text, DateTime, ForeignKey, JSON, func | |
| from app.database import Base | |
| from sqlalchemy.orm import relationship | |
| class Chapter(Base): | |
| __tablename__ = "chapters" | |
| id = Column(Integer, primary_key=True, autoincrement=True) | |
| project_id = Column(Integer, ForeignKey("projects.id"), nullable=False) | |
| chapter_number = Column(Integer, nullable=False) | |
| title = Column(String(500), nullable=True) | |
| source_text = Column(Text, nullable=False) | |
| word_count = Column(Integer, default=0) | |
| status = Column(String(50), default="raw") # raw, parsed, processed | |
| parsed_json = Column(JSON, nullable=True) # storyboard output | |
| created_at = Column(DateTime, server_default=func.now()) | |
| project = relationship("Project", back_populates="chapters") | |