Show the kiosk label prefix, and let a plugin declare the settings it owns

This commit is contained in:
2026-08-06 18:17:56 -04:00
parent 307de925f1
commit c674000ccc
15 changed files with 1070 additions and 475 deletions

View File

@@ -104,6 +104,28 @@ class BasePlugin(ABC):
"""
return []
def get_settings_defaults(self) -> List[Dict]:
"""Declare the Setting rows this plugin owns.
The framework seeds these at install, at enable, and on every
`flask plugin upgrade-all`, so a setting added in a later plugin
version reaches a site that installed an earlier one. Declaring a key
here is also what tells the settings API which category and type the
key belongs to, so a save never has to invent one.
Each entry is a dict:
key - the Setting key
value - default value (string form)
valuetype - 'string' | 'boolean' | 'integer' | 'json'
category - grouping the plugin's settings page filters on
description - what the setting does
public - True if an UNAUTHENTICATED caller may read it (kiosk
and print pages render before login); default False.
Never mark a credential or an integration URL public.
Return [] (default) if the plugin owns no settings.
"""
return []
def get_setting(self, key: str, default=None):
"""Read a plugin-scoped setting from the core Setting store.