Skip to main content

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​

PageWhat it covers
InstallationAdding habarico.contrib.preferences
Registering a preferenceDeclaring a key and its schema
Pydantic schemasUsing a Pydantic model instead of raw JSON Schema
Pattern keysOne declaration covering many keys
Callable defaultsDefaults computed per user
Built-in preferencesThe keys the admin UI itself uses
Reading and writingThe Python API
Public APIWhat the app exports
REST endpointsThe HTTP surface the frontend uses
Self-healing behaviourWhat happens when a stored value stops validating

See also​