reviewboard.reviews.managers¶
-
class
DefaultReviewerManager
[source]¶ Bases:
django.db.models.manager.Manager
A manager for DefaultReviewer models.
-
class
ReviewGroupManager
[source]¶ Bases:
django.db.models.manager.Manager
A manager for Group models.
-
accessible
(user, visible_only=True, local_site=None)[source]¶ Returns groups that are accessible by the given user.
-
-
class
ReviewRequestManager
[source]¶ Bases:
djblets.db.managers.ConcurrencyManager
A manager for review requests. Provides specialized queries to retrieve review requests with specific targets or origins, and to create review requests based on certain data.
-
create
(user, repository, commit_id=None, local_site=None, create_from_commit_id=False)[source]¶ Creates a new review request, optionally filling in fields based off a commit ID.
-
get_to_group_query
(group_name, local_site)[source]¶ Returns the query targetting a group.
This is meant to be passed as an extra_query to ReviewRequest.objects.public().
-
get_to_user_groups_query
(user_or_username)[source]¶ Returns the query targetting groups joined by a user.
This is meant to be passed as an extra_query to ReviewRequest.objects.public().
-
get_to_user_directly_query
(user_or_username)[source]¶ Returns the query targetting a user directly.
This will include review requests where the user has been listed as a reviewer, or the user has starred.
This is meant to be passed as an extra_query to ReviewRequest.objects.public().
-
get_to_user_query
(user_or_username)[source]¶ Returns the query targetting a user indirectly.
This will include review requests where the user has been listed as a reviewer, or a group that the user belongs to has been listed, or the user has starred.
This is meant to be passed as an extra_query to ReviewRequest.objects.public().
-
get_from_user_query
(user_or_username)[source]¶ Returns the query for review requests created by a user.
This is meant to be passed as an extra_query to ReviewRequest.objects.public().
-
-
class
ReviewManager
[source]¶ Bases:
djblets.db.managers.ConcurrencyManager
A manager for Review models.
This handles concurrency issues with Review models. In particular, it will try hard not to save two reviews at the same time, and if it does manage to do that (which may happen for pending reviews while a server is under heavy load), it will repair and consolidate the reviews on load. This prevents errors and lost data.
-
get_pending_review
(review_request, user)[source]¶ Returns a user’s pending review on a review request.
This will handle fixing duplicate reviews if more than one pending review is found.
-
fix_duplicate_reviews
(reviews)[source]¶ Fix duplicate reviews, condensing them into a single review.
This will consolidate the data from all reviews into the first review in the list, and return the first review.
-
from_user
(user_or_username, *args, **kwargs)[source]¶ Return the query for reviews created by a user.
Parameters: user_or_username (django.contrib.auth.models.User or unicode) – The user object or username to query for. Returns: A queryset for all the reviews created by the given user. Return type: django.db.models.query.QuerySet
-