djblets.siteconfig.forms¶
A base form for working with settings stored on SiteConfigurations.
- class SiteSettingsForm(siteconfig: SiteConfiguration, *args, **kwargs)[source]¶
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 [source]¶
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: Optional[SiteConfigurationSettingsValue] = None) Optional[SiteConfigurationSettingsValue] [source]¶
Return the value for a SiteConfiguration settings key.
- __annotations__ = {'request': 'HttpRequest', 'siteconfig': 'SiteConfiguration'}¶
- declared_fields = {}¶