reviewboard.integrations.models¶
Database models for integration configuration storage.
- class IntegrationConfig(*args, **kwargs)[source]¶
Bases:
GetIntegrationManagerMixin
,BaseIntegrationConfig
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.
- local_site[source]¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- load_conditions(form_cls, conditions_key='conditions')[source]¶
Load a set of conditions from the configuration.
This loads and deserializes a set of conditions from the configuration stored in the provided key. Those conditions can then be matched by the caller.
If the conditions are not found, this will return
None
.If the conditions cannot be deserialized, this will log some diagnostic output and error messages and return
None
.- Parameters:
- Returns:
The condition set based on the data, if found and if it could be loaded. Otherwise,
None
will be returned.- Return type:
- match_conditions(form_cls, conditions_key='conditions', **match_kwargs)[source]¶
Filter configurations based on a review request.
If the configuration contains a
conditions
key, and the configuration form contains a matching field, this will check the conditions for matches against the review request.- Parameters:
form_cls (
type
) –The configuration form class that owns the condition field.
This will generally be
my_integration.form_cls
, but can be another form in more complex integrations.conditions_key (
unicode
, optional) – The key for the conditions data in the configuration. Defaults to “conditions”.**match_kwargs (
dict
) – Keyword arguments to match for the conditions.
- Returns:
True
if the specified conditions in the configuration matches the provided keyword arguments.False
if not.- Return type:
- __annotations__ = {}¶
- enabled¶
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.
- 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()¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- integration_id¶
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.
- local_site_id¶
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- set_extra_data_json(json)¶
- set_settings_json(json)¶
- settings¶
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.