Jump to >

reviewboard.scmtools.conditions

Condition choices and operators for repositories and SCMTools.

class RepositoryConditionChoiceMixin[source]

Mixin for condition choices that operate off repositories.

This will set state needed to match against the choice.

class IsRepositoryPrivateOperator(choice)[source]

An operator for matching private repositories.

value_field = None[source]
matches(match_value, **kwargs)[source]

Return whether the repository is private.

Parameters
Returns

True if the repository is private. False if public.

Return type

bool

class IsRepositoryPublicOperator(choice)[source]

An operator for matching public repositories.

value_field = None[source]
matches(match_value, **kwargs)[source]

Return whether the repository is public.

Parameters
Returns

True if the repository is public. False if private.

Return type

bool

class RepositoriesChoice(**kwargs)[source]

A condition choice for matching repositories.

This is used to match a Repository against a list of repositories, against no repository (None), or against a repository public/private state.

get_queryset()[source]

Return the queryset used to look up repository choices.

Returns

The queryset for repositories.

Return type

django.db.models.query.QuerySet

get_match_value(repository, **kwargs)[source]

Return the value used for matching.

This will return the provided repository directly.

Parameters
Returns

The provided repository.

Return type

reviewboard.scmtools.models.Repository

class RepositoryTypeChoice(**kwargs)[source]

A condition choice for matching repository types.

This is used to match a Repository of a certain type (based on the Tool).

get_match_value(repository, **kwargs)[source]

Return the value used for matching.

This will return the Tool for the provided repository.

Parameters
Returns

The repository’s tool.

Return type

reviewboard.scmtools.models.Tool

class RepositoryConditionChoices(choices=[])[source]

A standard set of repository condition choices.

This provides a handful of condition choices that are useful for repositories. They can be used in integrations or any other place where conditions are used.