Nguyễn Thành Tuấn
feat: add Page model and background ChromaDB synchronization for institutes
baa2398 Download models.py from tuanyoko/AI-CTISE: direct link, hf CLI and curl.
- Browser
- Download file 950 Bytes
-
https://huggingface.co/spaces/tuanyoko/AI-CTISE/resolve/main/models.py
- Command line
-
hf download hf://spaces/tuanyoko/AI-CTISE/models.py
-
curl -L -o models.py https://huggingface.co/spaces/tuanyoko/AI-CTISE/resolve/main/models.py
950 Bytes
| from sqlalchemy import Column, Integer, String, Text, ForeignKey | |
| from sqlalchemy.orm import relationship | |
| from database import Base | |
| class Institute(Base): | |
| __tablename__ = "institutes" | |
| id = Column(Integer, primary_key=True, index=True) | |
| name = Column(String, index=True) | |
| description = Column(Text, nullable=True) | |
| address = Column(String, nullable=True) | |
| phone = Column(String, nullable=True) | |
| email = Column(String, nullable=True) | |
| website = Column(String, nullable=True) | |
| pages = relationship("Page", back_populates="institute", cascade="all, delete-orphan") | |
| class Page(Base): | |
| __tablename__ = "pages" | |
| id = Column(Integer, primary_key=True, index=True) | |
| title = Column(String, nullable=True) | |
| url = Column(String, nullable=True) | |
| content = Column(Text, nullable=True) | |
| institute_id = Column(Integer, ForeignKey("institutes.id")) | |
| institute = relationship("Institute", back_populates="pages") | |