Spaces:
Build error
Build error
Download src/db/models.py from Futyn-Maker/textmeme_search: direct link, hf CLI and curl.
- Browser
- Download file 797 Bytes
-
https://huggingface.co/spaces/Futyn-Maker/textmeme_search/resolve/main/src/db/models.py
- Command line
-
hf download hf://spaces/Futyn-Maker/textmeme_search/src/db/models.py
-
curl -L -o models.py https://huggingface.co/spaces/Futyn-Maker/textmeme_search/resolve/main/src/db/models.py
797 Bytes
| from sqlalchemy import Column, Integer, String, ForeignKey | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import relationship | |
| Base = declarative_base() | |
| class Public(Base): | |
| __tablename__ = "publics" | |
| id = Column(Integer, primary_key=True, index=True, autoincrement=True) | |
| public_vk = Column(String, unique=True, index=True) | |
| public_name = Column(String) | |
| memes = relationship("Meme", back_populates="public") | |
| class Meme(Base): | |
| __tablename__ = "memes" | |
| id = Column(Integer, primary_key=True, index=True, autoincrement=True) | |
| public_id = Column(Integer, ForeignKey("publics.id")) | |
| text = Column(String) | |
| image_url = Column(String) | |
| local_image_path = Column(String) | |
| public = relationship("Public", back_populates="memes") | |