Add support for config layers to SiteConfiguration.get().
Review Request #14431 — Created May 9, 2025 and submitted — Latest diff uploaded
This change adds a new
layers
argument toSiteConfiguration.get()
.
This allows passing in a list of additional settings dictionaries, which
will be checked before the main settings dict and defaults dicts.Callers can use this to add overrides for specific keys: for example,
one might want to have a global setting for the server, a setting for
tenant accounts, and even a user setting for individual users. This
would be accomplished by passing in
layers=[user_settings, tenant_settings]
.This also does some additional cleanup and typing for surrounding code,
reducing the noise I saw in my editor.
Ran unit tests.
Diff Revision 1
This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.
Commits
djblets/siteconfig/managers.py |
---|
djblets/siteconfig/models.py |
---|
djblets/siteconfig/tests.py |
---|