Spaces:
Sleeping
Sleeping
Download app/models/admin.py from AP314159/dialexus-chat: direct link, hf CLI and curl.
- Browser
- Download file 731 Bytes
-
https://huggingface.co/spaces/AP314159/dialexus-chat/resolve/main/app/models/admin.py
- Command line
-
hf download hf://spaces/AP314159/dialexus-chat/app/models/admin.py
-
curl -L -o admin.py https://huggingface.co/spaces/AP314159/dialexus-chat/resolve/main/app/models/admin.py
731 Bytes
| from sqlalchemy import Boolean, Column, Integer, String, Text, DateTime | |
| from sqlalchemy.orm import relationship | |
| from .base import Base | |
| import datetime | |
| class Admin(Base): | |
| __tablename__ = 'admins' | |
| id = Column(Integer, primary_key=True, index=True) | |
| username = Column(String(50), unique=True, nullable=False) | |
| password_hash = Column(Text, nullable=False) | |
| admin_key = Column(Text, unique=True, nullable=False) | |
| is_active = Column(Boolean, default=True) | |
| created_at = Column(DateTime, default=datetime.datetime.utcnow) | |
| users = relationship("User", back_populates="owner_admin", cascade="all, delete-orphan") | |
| groups = relationship("Group", back_populates="owner_admin", cascade="all, delete-orphan") |