Overview
TheSetting model provides a simple key-value store for application configuration data. It’s used internally by the system to persist settings like the master code hash, theme preferences, and other configuration options.
This model is primarily used by internal services. Most settings should be managed through the admin interface rather than direct database access.
Database Schema
data/models/setting.py
Fields
Setting identifier (primary key)Max length: 60 charactersCommon keys:
MASTER_CODE_HASH- Hashed master code for assistant elevationtheme- UI theme preference (light/dark)last_backup_at- Timestamp of last automatic backup
Setting value stored as textValues can be strings, JSON, timestamps, or hashed passwords depending on the key.
Usage Examples
Reading Settings
Writing Settings
Used By
The Setting model is accessed by:- Permissions Service - Stores and validates master code hash
- Theme Management - Persists user theme preferences
- Backup Service - Tracks last backup timestamp
Database Operations
Get Setting Value
Set Setting Value
Related Documentation
Permissions Service
Master code storage and validation
Admin Role
Admin settings management capabilities