Jump to >

reviewboard.notifications.models

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

Bases: django.db.models.base.Model

A target for a webhook.

A webhook target is a URL which will receive a POST request when the corresponding event occurs.

ALL_EVENTS = '*'[source]
EVENT_CHOICES = (('*', 'All events'), ('review_request_closed', 'Review request closed'), ('review_request_published', 'Review request published'), ('review_request_reopened', 'Review request reopened'), ('review_published', 'Review published'), ('reply_published', 'Reply published'))[source]
ENCODING_JSON = 'application/json'[source]
ENCODING_XML = 'application/xml'[source]
ENCODING_FORM_DATA = 'application/x-www-form-urlencoded'[source]
ALL_ENCODINGS = ('application/json', 'application/xml', 'application/x-www-form-urlencoded')[source]
ENCODINGS = (('application/json', 'JSON'), ('application/xml', 'XML'), ('application/x-www-form-urlencoded', 'Form Data'))[source]
APPLY_TO_ALL = 'A'[source]
APPLY_TO_NO_REPOS = 'N'[source]
APPLY_TO_SELECTED_REPOS = 'S'[source]
APPLY_TO_CHOICES = (('A', 'All review requests'), ('S', 'Only review requests on selected repositories'), ('N', 'Only review requests not associated with a repository (file attachments only)'))[source]
enabled[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

events[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

url[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

encoding[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

use_custom_content[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

custom_content[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

secret[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

apply_to[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

repositories[source]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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 a ForwardManyToOneDescriptor instance.

extra_data[source]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <reviewboard.notifications.managers.WebHookTargetManager object>[source]
__init__(*args, **kwargs)[source]

Initialize the model.

Parameters
  • *args (tuple) – Positional arguments to pass through to the Model constructor.

  • **kwargs (dict) – Keyword arguments to pass through to the Model constructor.

is_accessible_by(user, local_site=None)[source]

Return if the webhook can be accessed or modified by the user.

All superusers and admins of the webhook’s local site can access and modify the webhook.

Parameters
Returns

Whether or not the given user can access or modify the webhook through the given local site.

Return type

bool

__str__()[source]

Return str(self).

__annotations__ = {}
get_apply_to_display(*, field=<django.db.models.fields.CharField: apply_to>)
get_encoding_display(*, field=<django.db.models.fields.CharField: encoding>)
get_events_display()
get_events_list()
get_extra_data_json()
id

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
set_extra_data_json(json)