djblets.extensions.forms¶
Form definitions for extensions.
- class SettingsForm(extension: Extension, *args, request: HttpRequest | None = None, **kwargs)[source]¶
Bases:
KeyValueForm[ExtensionSettings]Settings form for extension configuration.
A base form for loading/saving settings for an extension. This is meant to be overridden by extensions to provide configuration pages. Any fields defined by the form will be loaded and saved automatically.
- __init__(extension: Extension, *args, request: HttpRequest | None = None, **kwargs) None[source]¶
Initialize the form.
- Parameters:
extension (
djblets.extensions.extension.Extension) – The extension instance.*args (
tuple) – Positional arguments to pass through to the parent class.request (
django.http.HttpRequest, optional) – The HTTP request from the client.**kwargs (
dict) – Keyword arguments to pass through to the parent class.
- set_key_value(key: str, value: djblets.util.typing.JSONValue) None[source]¶
Set the value for an extension settings key.
- __annotations__ = {}¶
- __orig_bases__ = (djblets.forms.forms.key_value_form.KeyValueForm[djblets.extensions.settings.ExtensionSettings],)¶
- __parameters__ = ()¶
- declared_fields = {}¶