Spaces:
Sleeping
Sleeping
Download models/setting.py from dev-haresh/nexus-ai: direct link, hf CLI and curl.
- Browser
- Download file 482 Bytes
-
https://huggingface.co/spaces/dev-haresh/nexus-ai/resolve/main/models/setting.py
- Command line
-
hf download hf://spaces/dev-haresh/nexus-ai/models/setting.py
-
curl -L -o setting.py https://huggingface.co/spaces/dev-haresh/nexus-ai/resolve/main/models/setting.py
482 Bytes
| from database import db | |
| class Setting(db.Model): | |
| __tablename__ = "settings" | |
| id = db.Column(db.Integer, primary_key=True) | |
| user_id = db.Column(db.Integer, db.ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True) | |
| key = db.Column(db.String(100), nullable=False) | |
| value = db.Column(db.Text, nullable=True) | |
| __table_args__ = (db.UniqueConstraint("user_id", "key"),) | |
| def to_dict(self): | |
| return {"key": self.key, "value": self.value} | |