Jump to >

reviewboard.reviews.conditions

Condition choices and operators for review requests and related objects.

class ReviewRequestConditionChoiceMixin[source]

Mixin for condition choices that operate off review requests.

This will set state needed to match against the choice.

class AnyReviewGroupsPublicOperator(choice)[source]

An operator for matching against any public review groups.

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

Return whether any review groups are public.

Parameters
  • match_value (list of reviewboard.reviews.models.group.Group) – The review groups to match.

  • **kwargs (dict) – Unused keyword arguments.

Returns

True if any review groups are public. False if all are invite-only or the list is empty.

Return type

bool

class AllReviewGroupsInviteOnlyOperator(choice)[source]

An operator for matching against all invite-only review groups.

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

Return whether all review groups in the list are invite-only.

Parameters
  • match_value (list of reviewboard.reviews.models.group.Group) – The review groups to match.

  • **kwargs (dict) – Unused keyword arguments.

Returns

True if all review group in the list are invite-only. False if any are public, or the list is empty.

Return type

bool

class ReviewGroupsChoice(**kwargs)[source]

A condition choice for matching review groups.

This is used to match a Group against a list of groups, against no group (empty list), or against a group’s public/invite-only state.

get_queryset()[source]

Return the queryset used to look up review group choices.

Returns

The queryset for review groups.

Return type

django.db.models.query.QuerySet

get_match_value(review_groups, value_state_cache, **kwargs)[source]

Return the review groups used for matching.

Parameters
Returns

The list of review groups.

Return type

list of reviewboard.reviews.models.group.Group

class ReviewRequestBranchChoice(**kwargs)[source]

A condition choice for matching a review request’s branch.

get_match_value(review_request, **kwargs)[source]

Return the branch text used for matching.

Parameters
Returns

The review request’s branch text.

Return type

unicode

class ReviewRequestDescriptionChoice(**kwargs)[source]

A condition choice for matching a review request’s description.

get_match_value(review_request, **kwargs)[source]

Return the description text used for matching.

Parameters
Returns

The review request’s description text.

Return type

unicode

class BaseReviewRequestDiffFileChoice(**kwargs)[source]

A condition choice for matching affected diff files on a review request.

This matches against a list of file paths that were added/modified/deleted on the latest diffset of a review request.

get_match_value(review_request, value_state_cache, **kwargs)[source]

Return the list of filenames used for matching.

Parameters
Returns

The set of filenames.

Return type

set of unicode

class ReviewRequestAnyDiffFileChoice(**kwargs)[source]
class ReviewRequestAllDiffFilesChoice(**kwargs)[source]
class ReviewRequestOwnerChoice(**kwargs)[source]

A condition choice for matching a review request’s owner.

get_match_value(review_request, **kwargs)[source]

Return the owner used for matching.

Parameters
Returns

The review request’s owner.

Return type

django.contrib.auth.models.User

class ReviewRequestReviewerChoice(**kwargs)[source]

A condition choice for matching a review request’s reviewer.

get_match_value(review_request, **kwargs)[source]

Return the reviewers used for matching.

Parameters
Returns

List of the review request’s reviewers.

Return type

list of django.contrib.auth.models.User

class ReviewRequestParticipantChoice(**kwargs)[source]

A condition choice for matching a review request’s participant.

get_match_value(review_request, **kwargs)[source]

Return the participants used for matching.

Parameters
Returns

The review request’s participants.

Return type

set of django.contrib.auth.models.User

class ReviewRequestSummaryChoice(**kwargs)[source]

A condition choice for matching a review request’s summary.

get_match_value(review_request, **kwargs)[source]

Return the summary text used for matching.

Parameters
Returns

The review request’s summary text.

Return type

unicode

class ReviewRequestTestingDoneChoice(**kwargs)[source]

A condition choice for matching a review request’s Testing Done field.

get_match_value(review_request, **kwargs)[source]

Return the testing done text used for matching.

Parameters
Returns

The review request’s testing done text.

Return type

unicode

class ReviewRequestRepositoriesChoice(**kwargs)[source]

A condition choice for matching a review request’s repositories.

get_match_value(review_request, **kwargs)[source]

Return the repository used for matching.

Parameters
Returns

The review request’s repository.

Return type

reviewboard.scmtools.models.Repository

class ReviewRequestRepositoryTypeChoice(**kwargs)[source]

A condition choice for matching a review request’s repository types.

get_match_value(review_request, **kwargs)[source]

Return the repository used for matching.

Parameters
Returns

The review request’s repository.

Return type

reviewboard.scmtools.models.Repository

class ReviewRequestReviewGroupsChoice(**kwargs)[source]

A condition choice for matching a review request’s review groups.

get_match_value(review_request, **kwargs)[source]

Return the review groups used for matching.

Parameters
Returns

The queryset for a review request’s target review groups.

Return type

django.db.models.query.QuerySet

class ReviewRequestConditionChoices(choices=[])[source]

A standard set of review request condition choices.

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