User preferences
A per-user, schema-validated key-value store. The admin UI keeps its context in it — dashboard layout, chosen columns, saved queries — so a user's setup follows them between devices.
Every key is registered together with a JSON Schema (or a Pydantic model) and an optional default. Only registered keys can be read or written, which is what keeps the store from turning into an unvalidated dumping ground.
Pages
| Page | What it covers |
|---|---|
| Installation | Adding habarico.contrib.preferences |
| Registering a preference | Declaring a key and its schema |
| Pydantic schemas | Using a Pydantic model instead of raw JSON Schema |
| Pattern keys | One declaration covering many keys |
| Callable defaults | Defaults computed per user |
| Built-in preferences | The keys the admin UI itself uses |
| Reading and writing | The Python API |
| Public API | What the app exports |
| REST endpoints | The HTTP surface the frontend uses |
| Self-healing behaviour | What happens when a stored value stops validating |
See also
- createBackendStore — the frontend store that syncs here
- SchemaAdmin —
syncPreferenceson the service config - SchemaProvider — the four methods that talk to these endpoints