djblets.siteconfig.forms¶
A base form for working with settings stored on SiteConfigurations.
- class SiteSettingsForm(siteconfig: SiteConfiguration, *args, **kwargs)¶
Bases:
KeyValueForm
A base form for loading/saving settings for a SiteConfiguration.
This is meant to be subclassed for different settings pages. Any fields defined by the form will be loaded/saved automatically.
- __init__(siteconfig: SiteConfiguration, *args, **kwargs) None ¶
Initialize the form.
- Parameters:
siteconfig (
djblets.siteconfig.models.SiteConfiguration
) – The site configuration to work with on the form.*args (
tuple
) – Positional arguments to pass to the parent constructor.**kwargs (
dict
) – Keyword arguments to pass to the parent constructor.
- request: HttpRequest¶
The HTTP request used for this form.
- Type:
- siteconfig: SiteConfiguration¶
The site configuration settings that are loaded from and saved to.
- get_key_value(key: str, default: Union[djblets.util.typing.JSONDict, djblets.util.typing.JSONDictImmutable, djblets.util.typing.JSONList, djblets.util.typing.JSONListImmutable, None, bool, float, int, str] = None) Union[djblets.util.typing.JSONDict, djblets.util.typing.JSONDictImmutable, djblets.util.typing.JSONList, djblets.util.typing.JSONListImmutable, None, bool, float, int, str] ¶
Return the value for a SiteConfiguration settings key.
- __annotations__ = {'request': 'HttpRequest', 'siteconfig': 'SiteConfiguration'}¶
- declared_fields = {}¶