djblets.integrations.models¶
Database models for integration configuration.
- class BaseIntegrationConfig(*args, **kwargs)¶
Bases:
NeedsIntegrationManagerMixin
,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_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- time_added¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- last_updated¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- enabled¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- settings¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- extra_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property integration: Integration¶
The integration for the configuration.
- get(key: str, default: Optional[Any] = None) Optional[Any] ¶
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.
- set(key: str, value: Optional[Any]) None ¶
Set a value for the given settings key.
This is equivalent to setting the value through the standard dictionary operators.
- __str__() str ¶
Return a string representation of this configuration.
- Returns:
The string representation.
- Return type:
- class Meta¶
Bases:
object
- abstract = False¶
- verbose_name = 'Integration configuration'¶
- verbose_name_plural = 'Integration configurations'¶
- __annotations__ = {}¶
- get_extra_data_json()¶
- get_next_by_last_updated(*, field=<django.db.models.fields.DateTimeField: last_updated>, is_next=True, **kwargs)¶
- get_next_by_time_added(*, field=<django.db.models.fields.DateTimeField: time_added>, is_next=True, **kwargs)¶
- get_previous_by_last_updated(*, field=<django.db.models.fields.DateTimeField: last_updated>, is_next=False, **kwargs)¶
- get_previous_by_time_added(*, field=<django.db.models.fields.DateTimeField: time_added>, is_next=False, **kwargs)¶
- get_settings_json()¶
- set_extra_data_json(json)¶
- set_settings_json(json)¶