Jump to >

djblets.integrations.models

Database models for integration configuration.

class BaseIntegrationConfig(*args, **kwargs)[source]

Bases: djblets.integrations.mixins.NeedsIntegrationManagerMixin, django.db.models.base.Model

Base class for stored configuration for a particular integration.

This contains configuration settings for a given instance of an integration, along with state indicating if that integration is to be enabled and user-specified identifying information.

This is meant to be subclassed, in order to provide additional state that may be needed by an application.

integration[source]

The integration for the configuration.

get(key, default=None)[source]

Return the setting for a given key.

This will return the setting’s stored value, or its default value for the integration if unset in these settings. If the setting isn’t set in either place, the provided default will be returned instead.

Parameters:
  • key (unicode) – The settings key.
  • default (object) – The default value, if not available elsewhere.
Returns:

The resulting value from settings, or the default value if not found.

set(key, value)[source]

Set a value for the given settings key.

This is equivalent to setting the value through the standard dictionary operators.

Parameters:
  • key (unicode) – The key to set.
  • value (object) – The settings value.
__str__()[source]
class Meta[source]
abstract = False[source]
verbose_name = _(u'Integration configuration')[source]
verbose_name_plural = _(u'Integration configurations')[source]
__unicode__()[source]
get_extra_data_json()[source]
get_next_by_last_updated(**morekwargs)[source]
get_next_by_time_added(**morekwargs)[source]
get_previous_by_last_updated(**morekwargs)[source]
get_previous_by_time_added(**morekwargs)[source]
get_settings_json()[source]
set_extra_data_json(json)[source]
set_settings_json(json)[source]