Files
classifieds/app/models/setting.py
T
nngo 2e9025fe55 06/16 Phase 6 foundation: admin blueprint, audit log, user management
Adds the admin backend foundation: AuditLog + Setting models/migration,
an admin-only dashboard with KPI cards, and user management (search,
ban/suspend/activate, tier override, trust adjust) with audit logging
on every write action. Smoke suite extended to 64 checks.
2026-06-16 11:45:00 -04:00

17 lines
522 B
Python

"""Admin-editable runtime settings (registration_open, flag_threshold, etc.)."""
from datetime import datetime
from sqlalchemy import JSON
from app.extensions import db
class Setting(db.Model):
__tablename__ = "settings"
key = db.Column(db.String(80), primary_key=True)
value = db.Column(JSON, nullable=True)
updated_at = db.Column(db.DateTime, default=datetime.utcnow,
onupdate=datetime.utcnow, nullable=False)
def __repr__(self):
return f"<Setting {self.key}>"