Jump to >

djblets.siteconfig.forms

A base form for working with settings stored on SiteConfigurations.

class SiteSettingsForm(siteconfig, *args, **kwargs)[source]

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.

request

The HTTP request used for this form.

Type

django.http.HttpRequest

siteconfig

The site configuration settings are loaded from and saved to.

Type

djblets.siteconfig.models.SiteConfiguration

get_key_value(key, default=None)[source]

Return the value for a SiteConfiguration settings key.

Parameters
  • key (unicode) – The settings key.

  • default (object) – The default value from the form, which will be ignored, so that the registered siteconfig defaults will be used.

Returns

The resulting value from the settings.

Return type

object

set_key_value(key, value)[source]

Set the value for a SiteConfiguration settings key.

Parameters
  • key (unicode) – The settings key.

  • value (object) – The settings value.

save_instance()[source]

Save the SiteConfiguration instance.