reviewboard.reviews.models¶
- class BaseComment(*args, **kwargs)¶
Bases:
Model
The base class for all comment types.
- OPEN = 'O'¶
- RESOLVED = 'R'¶
- DROPPED = 'D'¶
- VERIFYING_RESOLVED = 'A'¶
- VERIFYING_DROPPED = 'B'¶
- ISSUE_STATUSES = (('O', 'Open'), ('R', 'Resolved'), ('D', 'Dropped'), ('A', 'Waiting for verification to resolve'), ('B', 'Waiting for verification to drop'))¶
- ISSUE_STATUS_TO_STRING = {'A': 'verifying-resolved', 'B': 'verifying-dropped', 'D': 'dropped', 'O': 'open', 'R': 'resolved'}¶
- ISSUE_STRING_TO_STATUS = {'dropped': 'D', 'open': 'O', 'resolved': 'R', 'verifying-dropped': 'B', 'verifying-resolved': 'A'}¶
- issue_opened¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_status¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reply_to¶
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.
- timestamp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- rich_text¶
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.
- objects: ClassVar[CommentManager]¶
- static issue_status_to_string(status)¶
Return a string representation of the status field.
- static issue_string_to_status(status)¶
Return a DB representation of the given status string.
- property require_verification¶
Whether this comment requires verification before closing.
- __init__(*args, **kwargs)¶
Initialize the comment.
- get_review_request()¶
Return this comment’s review request.
- Returns:
The review request that this comment was made on.
- Return type:
- get_review() Review ¶
Return this comment’s review.
- Returns:
The review containing this comment.
- Return type:
- get_review_url()¶
Return the URL to view this comment.
- Returns:
The absolute URL to view this comment in the web UI.
- Return type:
- is_reply()¶
Return whether this comment is a reply to another comment.
- Returns:
True if the comment is a reply.
- Return type:
- is_accessible_by(user)¶
Return whether the user can access this comment.
- Parameters:
user (
django.contrib.auth.models.User
) – The user being checked.- Returns:
True if the given user can access this comment.
- Return type:
- is_mutable_by(user)¶
Return whether the user can modify this comment.
- Parameters:
user (
django.contrib.auth.models.User
) – The user being checked.- Returns:
True if the given user can modify this comment.
- Return type:
- public_replies(user=None)¶
Return the public replies to this comment.
- Parameters:
user (
django.contrib.auth.models.User
, optional) – A user to filter by, if desired. If specified, only replies authored by this user will be returned.- Returns:
The public replies to this comment.
- Return type:
- can_change_issue_status(user)¶
Return whether the user can change the issue status.
Currently, this is allowed for: - The user who owns the review request. - The user who opened the issue (posted the comment).
- Parameters:
user (
django.contrib.auth.models.User
) – The user being checked.- Returns:
True if the given user is allowed to change the issue status.
- Return type:
- can_verify_issue_status(user)¶
Return whether the user can verify the issue status.
Currently this is allowed for:
The user who opened the issue.
Administrators.
- Parameters:
user (
django.contrib.auth.models.User
) – The user being checked.- Returns:
True if the given user is allowed to verify the issue status.
- Return type:
- save(**kwargs)¶
Save the comment.
- Parameters:
**kwargs (
dict
) – Keyword arguments passed to the method (unused).
- __str__()¶
Return a string representation of the comment.
- Returns:
A string representation of the comment.
- Return type:
- __annotations__ = {'objects': 'ClassVar[CommentManager]'}¶
- get_extra_data_json()¶
- get_issue_status_display(*, field=<django.db.models.fields.CharField: issue_status>)¶
- get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)¶
- get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)¶
- reply_to_id¶
- set_extra_data_json(json)¶
- class Comment(*args, **kwargs)¶
Bases:
BaseComment
A comment made on a diff.
A comment can belong to a single filediff or to an interdiff between two filediffs. It can also have multiple replies.
- anchor_prefix = 'comment'¶
- comment_type = 'diff'¶
- filediff¶
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.
- interfilediff¶
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.
- first_line¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- num_lines¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property last_line¶
- property base_filediff_id: Optional[int]¶
The base FileDiff ID for the cumulative diff this comment is on.
- Type:
- property base_filediff: Optional[FileDiff]¶
The base filediff, if this comment is made on a commit range.
- get_absolute_url() str ¶
Return the URL for the given comment.
- Returns:
The URL to view the part of the file where the comment was added.
- Return type:
- diff_is_public() bool ¶
Return whether the diff(s) being commented on are public.
- Returns:
True if the diff (and interdiff, if applicable) is public.
- Return type:
- __annotations__ = {'objects': 'ClassVar[CommentManager]'}¶
- extra_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- filediff_id¶
- get_extra_data_json()¶
- get_issue_status_display(*, field=<django.db.models.fields.CharField: issue_status>)¶
- get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)¶
- get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- interfilediff_id¶
- issue_opened¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_status¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- replies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- reply_to¶
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.
- reply_to_id¶
- review¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- set_extra_data_json(json)¶
- text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- timestamp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class DefaultReviewer(*args, **kwargs)¶
Bases:
Model
Represents reviewers automatically added to review requests.
A default reviewer entry automatically adds default reviewers to a review request when the diff modifies a file matching the
file_regex
pattern specified.This is useful when different groups own different parts of a codebase. Adding DefaultReviewer entries ensures that the right people will always see the review request and discussions.
A
file_regex
of".*"
will add the specified reviewers by default for every review request.Note that this is keyed off the same LocalSite as its “repository” member.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- file_regex¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- repository¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- groups¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- people¶
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
andTopping.pizzas
areManyToManyDescriptor
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¶
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.
- objects: ClassVar[DefaultReviewerManager] = <reviewboard.reviews.managers.DefaultReviewerManager object>¶
- is_accessible_by(user)¶
Returns whether the user can access this default reviewer.
- is_mutable_by(user)¶
Returns whether the user can modify or delete this default reviewer.
Only those with the default_reviewer.change_group permission (such as administrators) can modify or delete default reviewers not bound to a LocalSite.
LocalSite administrators can modify or delete them on their LocalSites.
- __str__()¶
Return str(self).
- __annotations__ = {'objects': 'ClassVar[DefaultReviewerManager]'}¶
- 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¶
- class FileAttachmentComment(*args, **kwargs)¶
Bases:
BaseComment
A comment on a file attachment.
- anchor_prefix = 'fcomment'¶
- comment_type = 'file'¶
- file_attachment¶
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.
- diff_against_file_attachment¶
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.
- review_ui¶
Return a ReviewUI appropriate for this comment.
If a ReviewUI is available for this type of file, an instance of one will be returned that’s associated with this comment’s FileAttachment and the one being diffed against (if any).
- Returns:
The Review UI instance, if one is available.
- Return type:
- property thumbnail: Optional[SafeText]¶
Return the thumbnail for this comment, if any, as HTML.
The thumbnail will be generated from the appropriate ReviewUI, if there is one for this type of file.
- Returns:
The thumbnail for the file comment.
- Return type:
django.utils.safestring.SafeText
- get_absolute_url() Optional[str] ¶
Return the URL for this comment.
- Returns:
The URL to link to for the comment.
- Return type:
- get_link_text() Optional[str] ¶
Return the text for the link to the file.
- Returns:
The text to use for the link to the file.
- Return type:
- attachment_is_public() bool ¶
Return whether the attachment(s) being commented on are public.
- Returns:
True if the file attachment (and diff against file attachment, if applicable) is public.
- Return type:
- get_comment_diff_revision_info() Optional[FileAttachmentCommentRevisionInfo] ¶
Return the revision info for the comment.
New in version 7.0.
- Returns:
The revision information.
- Return type:
FileAttachmentCommentRevisionInfo
- __annotations__ = {'objects': 'ClassVar[CommentManager]'}¶
- diff_against_file_attachment_id¶
- extra_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- file_attachment_id¶
- get_extra_data_json()¶
- get_issue_status_display(*, field=<django.db.models.fields.CharField: issue_status>)¶
- get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)¶
- get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_opened¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_status¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- replies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- reply_to¶
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.
- reply_to_id¶
- review¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- set_extra_data_json(json)¶
- text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- timestamp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class GeneralComment(*args, **kwargs)¶
Bases:
BaseComment
A comment on a review request that is not tied to any code or file.
A general comment on a review request is used when a comment is not tied to specific lines of code or a special file attachment, and an issue is opened. Examples include suggestions for testing or pointing out errors in the change description.
- anchor_prefix = 'gcomment'¶
- comment_type = 'general'¶
- get_absolute_url()¶
- __annotations__ = {'objects': 'ClassVar[CommentManager]'}¶
- 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_issue_status_display(*, field=<django.db.models.fields.CharField: issue_status>)¶
- get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)¶
- get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_opened¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_status¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- replies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- reply_to¶
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.
- reply_to_id¶
- review¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- set_extra_data_json(json)¶
- text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- timestamp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class Group(*args, **kwargs)¶
Bases:
Model
A group of people who can be targeted for review.
This is usually used to separate teams at a company or components of a project.
Each group can have an e-mail address associated with it, sending all review requests and replies to that address. If that e-mail address is blank, e-mails are sent individually to each member of that group.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- display_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- mailing_list¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- email_list_only¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- users¶
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
andTopping.pizzas
areManyToManyDescriptor
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¶
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.
- is_default_group¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- incoming_request_count = <djblets.db.fields.counter_field.CounterField: incoming_request_count>¶
- invite_only¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- visible¶
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.
- objects: ClassVar[ReviewGroupManager] = <reviewboard.reviews.managers.ReviewGroupManager object>¶
- is_accessible_by(user, request=None, silent=False)¶
Returns true if the user can access this group.
- is_mutable_by(user)¶
Returns whether or not the user can modify or delete the group.
The group is mutable by the user if they are an administrator with proper permissions, or the group is part of a LocalSite and the user is in the admin list.
- __str__()¶
Return str(self).
- get_absolute_url()¶
- clean()¶
Clean method for checking null unique_together constraints.
Django has a bug where unique_together constraints for foreign keys aren’t checked properly if one of the relations is null. This means that users who aren’t using local sites could create multiple groups with the same name.
- __annotations__ = {'objects': 'ClassVar[ReviewGroupManager]'}¶
- decrement_incoming_request_count(*args, **kwargs)¶
- defaultreviewer_set¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- drafts¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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.
- increment_incoming_request_count(*args, **kwargs)¶
- local_site_id¶
- reinit_incoming_request_count()¶
- reload_incoming_request_count()¶
- repositories¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- review_requests¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- set_extra_data_json(json)¶
- starred_by¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class Review(*args, **kwargs)¶
Bases:
Model
A review of a review request.
- SHIP_IT_TEXT = 'Ship It!'¶
- REVOKED_SHIP_IT_TEXT = '~~Ship It!~~'¶
- FIX_IT_THEN_SHIP_IT_TEXT = 'Fix it, then Ship it!'¶
- review_request¶
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.
- user¶
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.
- timestamp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- public¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- ship_it¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- base_reply_to¶
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.
- email_message_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- time_emailed¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- body_top¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- body_top_rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- body_bottom¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- body_bottom_rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- body_top_reply_to¶
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.
- body_bottom_reply_to¶
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.
- comments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- screenshot_comments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- file_attachment_comments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- general_comments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- extra_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reviewed_diffset¶
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.
- objects: ClassVar[ReviewManager] = <reviewboard.reviews.managers.ReviewManager object>¶
- ship_it_only¶
Return if the review only contains a “Ship It!”.
- Returns:
True
if the review is only a “Ship It!” andFalse
otherwise.- Return type:
- can_user_revoke_ship_it(user)¶
Return whether a given user can revoke a Ship It.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check permissions for.- Returns:
True
if the user has permissions to revoke a Ship It.False
if they don’t.- Return type:
- revoke_ship_it(user)¶
Revoke the Ship It status on this review.
The Ship It status will be removed, and the
ReviewRequest.shipit_count
counter will be decremented.If the
body_top
text is equal toSHIP_IT_TEXT
, then it will replaced withREVOKED_SHIP_IT_TEXT
.Callers are responsible for checking whether the user has permission to revoke Ship Its by using
can_user_revoke_ship_it()
.- Raises:
reviewboard.reviews.errors.RevokeShipItError – The Ship It could not be revoked. Details will be in the error message.
- all_participants¶
Return all participants in the review’s discussion.
This will always contain the user who filed the review, plus every user who has published a reply to the review.
The result is cached. Repeated calls will return the same result.
- Returns:
The users who participated in the discussion.
- Return type:
- is_accessible_by(user)¶
Returns whether the user can access this review.
- is_mutable_by(user)¶
Returns whether the user can modify this review.
- __str__()¶
Return str(self).
- is_reply()¶
Returns whether or not this review is a reply to another review.
- is_new_for_user(user, last_visited)¶
Return whether this review is new for a user.
The review is considered new if their last visited time is older than the review’s published timestamp and the user is not the one who created the review.
- Parameters:
user (
django.contrib.auth.models.User
) – The user accessing the review.last_visited (
datetime.datetime
) – The last time the user accessed a page where the review would be shown.
- Returns:
True
if the review is new to this user.False
if it’s older than the last visited time or the user created it.- Return type:
- public_replies()¶
Returns a list of public replies to this review.
- public_body_top_replies(user=None)¶
Returns a list of public replies to this review’s body top.
- public_body_bottom_replies(user=None)¶
Returns a list of public replies to this review’s body bottom.
- get_pending_reply(user)¶
Return the pending reply owned by the specified user.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to find the reply for.- Returns:
The pending reply object, if present.
None
if there is no pending reply.- Return type:
- save(**kwargs)¶
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- can_publish(review_request_will_publish: bool = False) Tuple[bool, Optional[str]] ¶
Check if this review can be published.
- Parameters:
review_request_will_publish (
bool
, optional) – Whether the review request is also being published.- Returns:
A two-tuple describing whether the review can be published, and if not, why not.
- Return type:
- publish(user: Optional[User] = None, trivial: bool = False, to_owner_only: bool = False, request: Optional[HttpRequest] = None, review_request_will_publish: bool = False, *args, **kwargs) None ¶
Publish this review.
This will make the review public and update the timestamps of all contained comments.
- Parameters:
user (
django.contrib.auth.models.User
, optional) – The user publishing the review.trivial (
bool
, optional) – Whether to skip any e-mail notifications.to_owner_only (
bool
, optional) – Whether to address notifications only to the owner of the review request.request (
djang.http.HttpRequest
, optional) – The HTTP request.review_request_will_publish (
bool
, optional) –Whether the review request is also being published.
New in version 6.0.
*args (
tuple
) – Positional arguments for future expansion.**kwargs (
dict
) – Keyword arguments for future expansion.
- delete()¶
Deletes this review.
This will enforce that all contained comments are also deleted.
- get_absolute_url()¶
- get_all_comments(**kwargs)¶
Return a list of all contained comments of all types.
- has_comments(only_issues=False)¶
Return whether the review contains any comments/issues.
- __annotations__ = {'objects': 'ClassVar[ReviewManager]'}¶
- base_reply_to_id¶
- body_bottom_replies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- body_bottom_reply_to_id¶
- body_top_replies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- body_top_reply_to_id¶
- get_extra_data_json()¶
- get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)¶
- get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- replies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- review_request_id¶
- reviewed_diffset_id¶
- set_extra_data_json(json)¶
- status_update¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- user_id¶
- class ReviewRequest(*args, **kwargs)¶
Bases:
BaseReviewRequestDetails
A review request.
This is one of the primary models in Review Board. Most everything is associated with a review request.
The ReviewRequest model contains detailed information on a review request. Some fields are user-modifiable, while some are used for internal state.
- PENDING_REVIEW = 'P'¶
- SUBMITTED = 'S'¶
- DISCARDED = 'D'¶
- STATUSES = (('P', 'Pending Review'), ('S', 'Completed'), ('D', 'Discarded'))¶
- ISSUE_COUNTER_FIELDS = {'A': 'issue_verifying_count', 'B': 'issue_verifying_count', 'D': 'issue_dropped_count', 'O': 'issue_open_count', 'R': 'issue_resolved_count'}¶
- summary¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- submitter¶
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.
- time_added¶
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 descriptor for tracking the modification of a value.
- status¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- public¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- changenum¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- repository¶
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.
- email_message_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- time_emailed¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- diffset_history¶
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.
- target_groups¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- target_people¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- screenshots¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- inactive_screenshots¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- file_attachments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- inactive_file_attachments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- file_attachment_histories¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- changedescs¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- depends_on¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- last_review_activity_timestamp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- shipit_count = <djblets.db.fields.counter_field.CounterField: shipit_count>¶
- issue_open_count = <djblets.db.fields.counter_field.CounterField: issue_open_count>¶
- issue_resolved_count = <djblets.db.fields.counter_field.CounterField: issue_resolved_count>¶
- issue_dropped_count = <djblets.db.fields.counter_field.CounterField: issue_dropped_count>¶
- issue_verifying_count = <djblets.db.fields.counter_field.CounterField: issue_verifying_count>¶
- screenshots_count = <djblets.db.fields.relation_counter_field.RelationCounterField: screenshots_count>¶
- inactive_screenshots_count = <djblets.db.fields.relation_counter_field.RelationCounterField: inactive_screenshots_count>¶
- file_attachments_count = <djblets.db.fields.relation_counter_field.RelationCounterField: file_attachments_count>¶
- inactive_file_attachments_count = <djblets.db.fields.relation_counter_field.RelationCounterField: inactive_file_attachments_count>¶
- local_site¶
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.
- local_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects: ClassVar[ReviewRequestManager] = <reviewboard.reviews.managers.ReviewRequestManager object>¶
- static status_to_string(status: Optional[str]) str ¶
Return a string representation of a review request status.
- Parameters:
status (
str
) – A single-character string representing the status.- Returns:
A longer string representation of the status suitable for use in the API.
- Return type:
- Raises:
ValueError – The status was not a known value.
- static string_to_status(status: str) Optional[str] ¶
Return a review request status from an API string.
- Parameters:
status (
str
) – A string from the API representing the status.- Returns:
A single-character string representing the status, suitable for storage in the
status
field.- Return type:
- Raises:
ValueError – The status was not a known value.
- get_commit() Optional[str] ¶
Return the commit ID for the review request.
- Returns:
The commit ID for the review request, if present.
- Return type:
- set_commit(commit_id: str) None ¶
Set the commit ID for the review request.
- Parameters:
commit_id (
str
) – The commit ID to set.
- property commit: Optional[str]¶
Return the commit ID for the review request.
- Returns:
The commit ID for the review request, if present.
- Return type:
- property approved: bool¶
Return whether or not a review request is approved by reviewers.
On a default installation, a review request is approved if it has at least one Ship It!, and doesn’t have any open issues.
Extensions may customize approval by providing their own ReviewRequestApprovalHook.
- Returns:
Whether the review request is approved.
- Return type:
- property approval_failure: str¶
An error indicating why a review request isn’t approved.
If
approved
isFalse
, this will provide the text describing why it wasn’t approved.Extensions may customize approval by providing their own ReviewRequestApprovalHook.
- Type:
- property owner: User¶
The owner of a review request.
This is an alias for
submitter
. It provides compatibility withReviewRequestDraft.owner
, for functions working with either method, and for review request fields, but it cannot be used for queries.
- property created_with_history: bool¶
Whether or not this review request was created with commit support.
This property can only be changed before the review request is created (i.e., before
save()
is called and it has a primary key assigned).- Type:
- property review_participants: set[django.contrib.auth.models.User]¶
The participants in reviews on the review request.
This will contain the users who published any reviews or replies on the review request. The list will be in username sort order and will not contain duplicates.
This will only contain the owner of the review request if they’ve filed a review or reply.
- Type:
- get_display_id() int ¶
Return the ID that should be exposed to the user.
- Returns:
The ID that should be shown to the user.
- Return type:
- property display_id: int¶
Return the ID that should be exposed to the user.
- Returns:
The ID that should be shown to the user.
- Return type:
- get_new_reviews(user: User) QuerySet[Review] ¶
Return all new reviews since last viewing this review request.
This will factor in the time the user last visited the review request, and find any reviews that have been added or updated since.
- Returns:
The queryset for new reviews since the user last visited the page.
- Return type:
django.db.models.QuerySet
- get_public_reviews() QuerySet[Review] ¶
Return all public top-level reviews for this review request.
- Returns:
A queryset for the public top-level reviews.
- Return type:
django.db.models.QuerySet
- is_accessible_by(user: User, local_site: Optional[LocalSite] = None, request: Optional[HttpRequest] = None, silent: bool = False) bool ¶
Return whether or not the user can read this review request.
This performs several checks to ensure that the user has access. This user has access if:
The review request is public or the user can modify it (either by being an owner or having special permissions).
The repository is public or the user has access to it (either by being explicitly on the allowed users list, or by being a member of a review group on that list).
The user is listed as a requested reviewer or the user has access to one or more groups listed as requested reviewers (either by being a member of an invite-only group, or the group being public).
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.local_site (
reviewboard.site.models.LocalSite
, optional) – The local site to check against, if present.request (
django.http.HttpRequest
, optional) – The current HTTP request.silent (
bool
, optional) – Whether to suppress audit log messages.
- Returns:
Whether the review request is accessible by the user.
- Return type:
- is_mutable_by(user: User) bool ¶
Return whether the user can modify this review request.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
Whether the user can modify this review request.
- Return type:
- is_status_mutable_by(user: User) bool ¶
Return whether the user can modify this review request’s status.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
Whether the user can modify this review request’s status.
- Return type:
- is_deletable_by(user: User) bool ¶
Return whether the user can delete this review request.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
Whether the user can delete this review request.
- Return type:
- get_draft(user: Optional[Union[AbstractBaseUser, AnonymousUser]] = None) Optional[ReviewRequestDraft] ¶
Return the draft of the review request.
If a user is specified, then the draft will be returned only if it is accessible by the user. Otherwise,
None
will be returned.Changed in version 7.0.2: Changed the behavior of the
user
argument to check if the draft is accessible rather than checking ownership.- Parameters:
user (
django.contrib.auth.models.User
) – The user who must own the draft.- Returns:
The draft of the review request or None.
- Return type:
reviewboard.reviews.models.review_request_draft.ReviewRequestDraft
- get_pending_review(user: User) Optional[Review] ¶
Return the pending review owned by the specified user, if any.
This will return an actual review, not a reply to a review.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to query for reviews.- Returns:
The user’s review, if present.
- Return type:
- get_last_activity_info(diffsets: Optional[list[DiffSet]] = None, reviews: Optional[list[Review]] = None) LastActivityInfo ¶
Return the last public activity information on the review request.
- Parameters:
diffsets (
list
ofreviewboard.diffviewer.models.DiffSet
, optional) –The list of diffsets to compare for latest activity.
If not provided, this will be populated with the last diffset.
reviews (
list
ofreviewboard.reviews.models.Review
, optional) –The list of reviews to compare for latest activity.
If not provided, this will be populated with the latest review.
- Returns:
A dictionary with the following keys:
timestamp
:The
datetime
that the object was updated.updated_object
:The object that was updated. This will be one of the following:
The
ReviewRequest
itself.A
Review
.A
DiffSet
.
changedesc
:The latest
ChangeDescription
, if any.
- Return type:
- changeset_is_pending(commit_id: Optional[str]) tuple[bool, Optional[str]] ¶
Return whether the associated changeset is pending commit.
For repositories that support it, this will return whether the associated changeset is pending commit. This requires server-side knowledge of the change.
- get_absolute_url() str ¶
Return the absolute URL to the review request.
- Returns:
The absolute URL to the review request.
- Return type:
- get_diffsets() list[DiffSet] ¶
Return a list of all diffsets on this review request.
This will also fetch all associated FileDiffs, as well as a count of the number of files (stored in DiffSet.file_count).
Changed in version 7.0: Made this pre-fetch the related DiffCommit objects.
- Returns:
The list of all diffsets on the review request.
- Return type:
- get_latest_diffset() Optional[DiffSet] ¶
Return the latest diffset for this review request.
- Returns:
The latest published DiffSet, if present.
- Return type:
- get_close_info() ReviewRequestCloseInfo ¶
Return metadata of the most recent closing of a review request.
This is a helper which is used to gather the data which is rendered in the close description boxes on various pages.
- Returns:
The close information.
- Return type:
ReviewRequestCloseInfo
- get_blocks() Sequence[ReviewRequest] ¶
Return the list of review request this one blocks.
The returned value will be cached for future lookups.
- Returns:
A list of the review requests which are blocked by this one.
- Return type:
- get_file_attachments_data(*, active_attachments: Optional[FileAttachmentSequence] = None, inactive_attachments: Optional[FileAttachmentSequence] = None, draft_active_attachments: Optional[FileAttachmentSequence] = None, draft_inactive_attachments: Optional[FileAttachmentSequence] = None) ReviewRequestFileAttachmentsData ¶
Return data about a review request and its draft’s file attachments.
This returns sets of the active and inactive file attachment IDs that are attached to the review request or its draft. This data is used in
get_file_attachment_state()
.The active and inactive file attachments on the review request and its draft may be passed in to avoid fetching them again if they’ve already been fetched elsewhere.
The returned data will be cached for future lookups.
New in version 6.0.
- Parameters:
active_attachments (
list
ofFileAttachment
, optional) – The list of active file attachments on the review request.inactive_attachments (
list
ofFileAttachment
, optional) – The list of inactive file attachments on the review request.draft_active_attachments (
list
ofFileAttachment
, optional) – The list of active file attachments on the review request draft.draft_inactive_attachments (
list
ofFileAttachment
, optional) – The list of inactive file attachments on the review request draft.
- Returns:
The data about the file attachments on a review request and its draft.
- Return type:
ReviewRequestFileAttachmentsData
- get_file_attachment_state(file_attachment: FileAttachment) FileAttachmentState ¶
Get the state of a file attachment attached to this review request.
New in version 6.0.
- Parameters:
file_attachment (
reviewboard.attachments.models.FileAttachment
) – The file attachment whose state will be returned.- Returns:
The file attachment state.
- Return type:
FileAttachmentState
- save(update_counts: bool = False, old_submitter: Optional[User] = None, **kwargs) None ¶
Save the review request.
- Parameters:
update_counts (
bool
, optional) – Whether to update the review request counters for the given user.old_submitter (
django.contrib.auth.models.User
, optional) – The previous owner of the review request, if it is being reassigned.**kwargs (
dict
) – Keyword arguments to pass through to the parent class.
- delete(**kwargs) None ¶
Delete the review request.
- Parameters:
**kwargs (
dict
) – Keyword arguments to pass through to the parent class.
- can_publish() bool ¶
Return whether this review request can be published.
- Returns:
True
if the review request is not yet public, or if there is a draft present.- Return type:
- can_add_default_reviewers() bool ¶
Return whether default reviewers can be added to the review request.
Default reviewers can only be added if the review request supports repositories and doesn’t yet have any published diffs.
- Returns:
True
if new default reviewers can be added.False
if they cannot.- Return type:
- close(close_type: str, user: Optional[User] = None, description: Optional[str] = None, rich_text: bool = False, **kwargs) None ¶
Close the review request.
Changed in version 6.0: The
type
argument has been completely removed.Changed in version 3.0: The
type
argument is deprecated:close_type
should be used instead.This method raises
ValueError
instead ofAttributeError
when theclose_type
has an incorrect value.- Parameters:
close_type (
str
) – How the close occurs. This should be one ofSUBMITTED
orDISCARDED
.user (
django.contrib.auth.models.User
, optional) – The user who is closing the review request.description (
str
, optional) – An optional description that indicates why the review request was closed.rich_text (
bool
, optional) – Indicates whether or not that the description is rich text.**kwargs (
dict
, unused) – Additional keyword arguments, for future expansion.
- Raises:
ValueError – The provided close type is not a valid value.
reviewboard.reviews.errors.PermissionError – The user does not have permission to close the review request.
reviewboard.reviews.errors.PublishError – An attempt was made to close an un-published review request as submitted.
- reopen(user: Optional[User] = None) None ¶
Reopen the review request for review.
- Parameters:
user (
django.contrib.auth.models.User
, optional) – The user making the change.
- publish(user: User, trivial: bool = False, validate_fields: bool = True) Optional[ChangeDescription] ¶
Publish the current draft attached to this review request.
The review request will be mark as public, and signals will be emitted for any listeners.
Changed in version 6.0: Added the change description as a return type.
- Parameters:
user (
django.contrib.auth.models.User
) – The user performing the publish operation.trivial (
bool
, optional) – Whether to skip any e-mail notifications.validate_fields (
bool
, optional) – Whether to validate fields before publishing.
- Returns:
The change description, if this was an update to an already-public review request. If this is an initial publish, this will return
None
.- Return type:
- Raises:
reviewboard.reviews.errors.PublishError – An error occurred while publishing.
- determine_user_for_changedesc(changedesc: ChangeDescription) User ¶
Determine the user associated with the change description.
- Parameters:
changedesc (
reviewboard.changedescs.models.ChangeDescription
) – The change description.- Returns:
The user associated with the change description.
- Return type:
- get_review_request() ReviewRequest ¶
Return this review request.
This is provided so that consumers can be passed either a ReviewRequest or a ReviewRequestDraft and retrieve the actual ReviewRequest regardless of the object.
- Returns:
This object.
- Return type:
- __annotations__ = {'objects': 'ClassVar[ReviewRequestManager]'}¶
- blocks¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- branch¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- bugs_closed¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- commit_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- decrement_file_attachments_count(*args, **kwargs)¶
- decrement_inactive_file_attachments_count(*args, **kwargs)¶
- decrement_inactive_screenshots_count(*args, **kwargs)¶
- decrement_issue_dropped_count(*args, **kwargs)¶
- decrement_issue_open_count(*args, **kwargs)¶
- decrement_issue_resolved_count(*args, **kwargs)¶
- decrement_issue_verifying_count(*args, **kwargs)¶
- decrement_screenshots_count(*args, **kwargs)¶
- decrement_shipit_count(*args, **kwargs)¶
- description¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- description_rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- diffset_history_id¶
- draft¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- draft_blocks¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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=<djblets.db.fields.modification_timestamp_field.ModificationTimestampField: 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=<djblets.db.fields.modification_timestamp_field.ModificationTimestampField: last_updated>, is_next=False, **kwargs)¶
- get_previous_by_time_added(*, field=<django.db.models.fields.DateTimeField: time_added>, is_next=False, **kwargs)¶
- get_status_display(*, field=<django.db.models.fields.CharField: status>)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- increment_file_attachments_count(*args, **kwargs)¶
- increment_inactive_file_attachments_count(*args, **kwargs)¶
- increment_inactive_screenshots_count(*args, **kwargs)¶
- increment_issue_dropped_count(*args, **kwargs)¶
- increment_issue_open_count(*args, **kwargs)¶
- increment_issue_resolved_count(*args, **kwargs)¶
- increment_issue_verifying_count(*args, **kwargs)¶
- increment_screenshots_count(*args, **kwargs)¶
- increment_shipit_count(*args, **kwargs)¶
- local_site_id¶
- reinit_file_attachments_count()¶
- reinit_inactive_file_attachments_count()¶
- reinit_inactive_screenshots_count()¶
- reinit_issue_dropped_count()¶
- reinit_issue_open_count()¶
- reinit_issue_resolved_count()¶
- reinit_issue_verifying_count()¶
- reinit_screenshots_count()¶
- reinit_shipit_count()¶
- reload_file_attachments_count()¶
- reload_inactive_file_attachments_count()¶
- reload_inactive_screenshots_count()¶
- reload_issue_dropped_count()¶
- reload_issue_open_count()¶
- reload_issue_resolved_count()¶
- reload_issue_verifying_count()¶
- reload_screenshots_count()¶
- reload_shipit_count()¶
- repository_id¶
- reviews¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- set_extra_data_json(json)¶
- starred_by¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- status_updates¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- submitter_id¶
- testing_done¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- testing_done_rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- trophies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- visits¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class ReviewRequestDraft(*args, **kwargs)¶
Bases:
BaseReviewRequestDetails
A draft of a review request.
When a review request is being modified, a special draft copy of it is created containing all the details of the review request. This copy can be modified and eventually saved or discarded. When saved, the new details are copied back over to the originating ReviewRequest.
- summary¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- owner¶
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.
- review_request¶
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.
- last_updated¶
A descriptor for tracking the modification of a value.
- diffset¶
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.
- changedesc¶
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.
- target_groups¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- target_people¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- screenshots¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- inactive_screenshots¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- file_attachments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- inactive_file_attachments¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- property submitter¶
- property repository¶
- property local_site¶
- depends_on¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- screenshots_count = <djblets.db.fields.relation_counter_field.RelationCounterField: screenshots_count>¶
- inactive_screenshots_count = <djblets.db.fields.relation_counter_field.RelationCounterField: inactive_screenshots_count>¶
- file_attachments_count = <djblets.db.fields.relation_counter_field.RelationCounterField: file_attachments_count>¶
- inactive_file_attachments_count = <djblets.db.fields.relation_counter_field.RelationCounterField: inactive_file_attachments_count>¶
- objects: ClassVar[ConcurrencyManager] = <djblets.db.managers.ConcurrencyManager object>¶
- property commit¶
- get_latest_diffset() Optional[DiffSet] ¶
Return the diffset for this draft.
- Returns:
The diffset for the draft.
- Return type:
- is_accessible_by(user: Union[AbstractBaseUser, AnonymousUser]) bool ¶
Return whether or not the user can access this draft.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
Whether the user can access the draft.
- Return type:
- is_mutable_by(user: Union[AbstractBaseUser, AnonymousUser]) bool ¶
Return whether or not the user can modify this draft.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
Whether the user can modify the draft.
- Return type:
- get_file_attachments_data(*, active_attachments: Optional[FileAttachmentSequence] = None, inactive_attachments: Optional[FileAttachmentSequence] = None, draft_active_attachments: Optional[FileAttachmentSequence] = None, draft_inactive_attachments: Optional[FileAttachmentSequence] = None, **kwargs) ReviewRequestFileAttachmentsData ¶
Return data about a review request and its draft’s file attachments.
This returns sets of the active and inactive file attachment IDs that are attached to the review request or its draft. This data is used in
ReviewRequest.get_file_attachment_state()
.The active and inactive file attachments on the review request and its draft may be passed in to avoid fetching them again if they’ve already been fetched elsewhere.
The returned data will be cached for future lookups.
New in version 6.0.
- Parameters:
active_attachments (
list
, optional) – The list of active file attachments on the review request.inactive_attachments (
list
, optional) – The list of inactive file attachments on the review request.draft_active_attachments (
list
, optional) – The list of active file attachments on the review request draft.draft_inactive_attachments (
list
, optional) – The list of inactive file attachments on the review request draft.**kwargs (
dict
, unused) – Keyword arguments for future expansion.
- Returns:
The data about the file attachments on a review request and its draft.
- Return type:
ReviewRequestFileAttachmentsData
- get_file_attachment_state(file_attachment: FileAttachment) FileAttachmentState ¶
Get the state of a file attachment attached to this review request.
New in version 6.0.
- Parameters:
file_attachment (
reviewboard.attachments.models.FileAttachment
) – The file attachment whose state will be returned.- Returns:
The file attachment state.
- Return type:
FileAttachmentState
- static create(review_request, changedesc=None)¶
Create a draft based on a review request.
This will copy over all the details of the review request that we care about. If a draft already exists for the review request, the draft will be returned.
- Parameters:
review_request (
reviewboard.reviews.models.review_request.ReviewRequest
) – The review request to fetch or create the draft from.changedesc (
reviewboard.changedescs.models.ChangeDescription
) – A custom change description to set on the draft. This will always be set, overriding any previous one if already set.
- Returns:
The resulting draft.
- Return type:
- publish(review_request: Optional[ReviewRequest] = None, user: Optional[User] = None, trivial: bool = False, send_notification: bool = True, validate_fields: bool = True, timestamp: Optional[datetime] = None) ChangeDescription ¶
Publish this draft.
This is an internal method. Programmatic publishes should use
reviewboard.reviews.models.review_request.ReviewRequest.publish()
instead.This updates and returns the draft’s ChangeDescription, which contains the changed fields. This is used by the e-mail template to tell people what’s new and interesting.
The keys that may be saved in
fields_changed
in the ChangeDescription are:submitter
summary
description
testing_done
bugs_closed
depends_on
branch
target_groups
target_people
screenshots
screenshot_captions
diff
Any custom field IDs
Each field in ‘fields_changed’ represents a changed field. This will save fields in the standard formats as defined by the ‘ChangeDescription’ documentation, with the exception of the ‘screenshot_captions’ and ‘diff’ fields.
For the ‘screenshot_captions’ field, the value will be a dictionary of screenshot ID/dict pairs with the following fields:
old
: The old value of the fieldnew
: The new value of the field
For the
diff
field, there is only ever anadded
field, containing the ID of the new diffset.- Parameters:
review_request (
reviewboard.reviews.models.review_request.ReviewRequest
, optional) – The review request associated with this diff. If not provided, it will be looked up.user (
django.contrib.auth.models.User
, optional) – The user publishing the draft. If not provided, this defaults to the review request submitter.trivial (
bool
, optional) –Whether or not this is a trivial publish.
Trivial publishes do not result in e-mail notifications.
send_notification (
bool
, optional) –Whether or not this will emit the
reviewboard.reviews.signals.review_request_published
signal.This parameter is intended for internal use only.
validate_fields (
bool
, optional) –Whether or not the fields should be validated.
This should only be
False
in the case of programmatic publishes, e.g., from close as submitted hooks.timestamp (
datetime.datetime
, optional) – The datetime that should be used for all timestamps for objects published (DiffSet
,ChangeDescription
) over the course of the method.
- Returns:
The change description that results from this publish (if any).
If this is an initial publish, there will be no change description (and this function will return
None
).- Return type:
- update_from_commit_id(commit_id)¶
Update the data from a server-side changeset.
If the commit ID refers to a pending changeset on an SCM which stores such things server-side (like Perforce), the details like the summary and description will be updated with the latest information.
If the change number is the commit ID of a change which exists on the server, the summary and description will be set from the commit’s message, and the diff will be fetched from the SCM.
- Parameters:
commit_id (
unicode
) – The commit ID or changeset ID that the draft will update from.- Returns:
The list of draft fields that have been updated from the commit.
- Return type:
- Raises:
reviewboard.hostingsvcs.errors.HostingServiceError – The hosting service backing the repository encountered an error.
reviewboard.scmtools.errors.InvalidChangeNumberError – The commit ID could not be found in the repository.
reviewboard.scmtools.errors.SCMError – The repository tool encountered an error.
NotImplementedError – The repository does not support fetching information from commit IDs.
- update_from_pending_change(commit_id: str, changeset: ChangeSet) List[str] ¶
Update the data from a server-side pending changeset.
This will fetch the metadata from the server and update the fields on the draft.
Changed in version 6.0: Added support for setting
extra_data
.- Parameters:
commit_id (
str
) – The changeset ID that the draft will update from.changeset (
reviewboard.scmtools.core.ChangeSet
) – The changeset information to update from.
- Returns:
The list of draft fields that have been updated from the change.
- Return type:
- Raises:
reviewboard.scmtools.errors.InvalidChangeNumberError – A changeset could not be found.
- update_from_committed_change(commit_id)¶
Update from a committed change present on the server.
Fetches the commit message and diff from the repository and sets the relevant fields.
- copy_fields_to_request(review_request: ReviewRequest) None ¶
Copy draft fields to the review request.
This will loop through all fields on the review request, copying any changes from the draft to the review request, in preparation for a publish.
- Parameters:
review_request (
reviewboard.reviews.models.review_request.ReviewRequest
) – The review request to copy the fields to.
- get_review_request()¶
Returns the associated review request.
- __annotations__ = {'objects': 'ClassVar[ConcurrencyManager]'}¶
- branch¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- bugs_closed¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- changedesc_id¶
- commit_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- decrement_file_attachments_count(*args, **kwargs)¶
- decrement_inactive_file_attachments_count(*args, **kwargs)¶
- decrement_inactive_screenshots_count(*args, **kwargs)¶
- decrement_screenshots_count(*args, **kwargs)¶
- description¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- description_rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- diffset_id¶
- 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=<djblets.db.fields.modification_timestamp_field.ModificationTimestampField: last_updated>, is_next=True, **kwargs)¶
- get_previous_by_last_updated(*, field=<djblets.db.fields.modification_timestamp_field.ModificationTimestampField: last_updated>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- increment_file_attachments_count(*args, **kwargs)¶
- increment_inactive_file_attachments_count(*args, **kwargs)¶
- increment_inactive_screenshots_count(*args, **kwargs)¶
- increment_screenshots_count(*args, **kwargs)¶
- owner_id¶
- reinit_file_attachments_count()¶
- reinit_inactive_file_attachments_count()¶
- reinit_inactive_screenshots_count()¶
- reinit_screenshots_count()¶
- reload_file_attachments_count()¶
- reload_inactive_file_attachments_count()¶
- reload_inactive_screenshots_count()¶
- reload_screenshots_count()¶
- review_request_id¶
- rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- set_extra_data_json(json)¶
- testing_done¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- testing_done_rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class Screenshot(*args, **kwargs)¶
Bases:
Model
A screenshot associated with a review request.
Like diffs, a screenshot can have comments associated with it. These comments are of type
reviewboard.reviews.models.ScreenshotComment
.A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- image¶
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- property filename¶
Returns the filename for display purposes.
- get_comments()¶
Returns all the comments made on this screenshot.
- get_thumbnail_url()¶
Returns the URL for the thumbnail, creating it if necessary.
- thumb()¶
Create and returns HTML for this screenshot’s thumbnail.
- Returns:
The rendered HTML.
- Return type:
django.util.safetext.SafeString
- property display_name¶
Return a display name for the file.
- __str__()¶
Return str(self).
- get_review_request()¶
- get_absolute_url()¶
- save(**kwargs)¶
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- __annotations__ = {}¶
- comments¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- drafts¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inactive_drafts¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- inactive_review_request¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- objects = <django.db.models.manager.Manager object>¶
- review_request¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class ScreenshotComment(*args, **kwargs)¶
Bases:
BaseComment
A comment on a screenshot.
- anchor_prefix = 'scomment'¶
- comment_type = 'screenshot'¶
- screenshot¶
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.
- x¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- y¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- w¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- h¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_image_url()¶
Returns the URL for the thumbnail, creating it if necessary.
- image()¶
Returns HTML for a section of the screenshot for this comment.
This will generate the cropped part of the screenshot referenced by this comment and returns the HTML markup embedding it.
- __annotations__ = {'objects': 'ClassVar[CommentManager]'}¶
- 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_issue_status_display(*, field=<django.db.models.fields.CharField: issue_status>)¶
- get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)¶
- get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_opened¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- issue_status¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- replies¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- reply_to¶
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.
- reply_to_id¶
- review¶
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- rich_text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- screenshot_id¶
- set_extra_data_json(json)¶
- text¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- timestamp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class StatusUpdate(*args, **kwargs)¶
Bases:
Model
A status update from a third-party service or extension.
This status model allows external services (such as continuous integration services, Review Bot, etc.) to provide an update on their status. An example of this would be a CI tool which does experimental builds of changes. While the build is running, that tool would set its status to pending, and when it was done, would set it to one of the done states, and potentially associate it with a review containing issues.
- PENDING = 'P'¶
The pending state.
- DONE_SUCCESS = 'S'¶
The completed successfully state.
- DONE_FAILURE = 'F'¶
The completed with reported failures state.
- ERROR = 'E'¶
The error state.
- TIMEOUT = 'T'¶
Timeout state.
- NOT_YET_RUN = 'R'¶
Not yet run state.
- STATUSES = (('P', 'Pending'), ('S', 'Done (Success)'), ('F', 'Done (Failure)'), ('E', 'Error'), ('T', 'Timed Out'), ('R', 'Not Yet Run'))¶
- service_id¶
An identifier for the service posting this status update.
This ID is self-assigned, and just needs to be unique to that service. Possible values can be an extension ID, webhook URL, or a script name.
- user¶
The user who created this status update.
- timestamp¶
The timestamp of the status update.
- summary¶
A user-visible short summary of the status update.
This is typically the name of the integration or tool that was run.
- description¶
A user-visible description on the status update.
This is shown in the UI adjacent to the summary. Typical results might be things like “running.” or “failed.”. This should include punctuation.
- url¶
An optional link.
This is used in case the tool has some external page, such as a build results page on a CI system.
- url_text¶
Text for the link. If
url
is empty, this will not be used.
- state¶
The current state of this status update.
This should be set to
PENDING
while the service is processing the update, and then to eitherDONE_SUCCESS
orDONE_FAILURE
once complete. If the service encountered some error which prevented completion, this should be set toERROR
.
- review_request¶
The review request that this status update is for.
- change_description¶
The change to the review request that this status update is for.
If this is
None
, this status update refers to the review request as a whole (for example, the initial diff that was posted).
- review¶
An optional review created for this status update.
This allows the third-party service to create comments and open issues.
- extra_data¶
Any extra data that the service wants to store for this status update.
- timeout¶
An (optional) timeout, in seconds. If this is non-None and the state has been
PENDING
for longer than this period (computed from thetimestamp
field),effective_state
will beTIMEOUT
.
- objects: ClassVar[StatusUpdateManager] = <reviewboard.reviews.managers.StatusUpdateManager object>¶
- static state_to_string(state)¶
Return a string representation of a status update state.
- static string_to_state(state)¶
Return a status update state from an API string.
- property integration_config: Optional[IntegrationConfig]¶
The integration config that manages this status update, if any.
If the stored configuration no longer exists, or is no longer applicable to any associated Local Site, then this will be
None
.The configuration is cached for repeated lookups.
New in version 5.0.3.
- is_mutable_by(user)¶
Return whether the user can modify this status update.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
True if the user can modify this status update.
- Return type:
- property effective_state¶
The state of the status update, taking into account timeouts.
- drop_open_issues()¶
Drop any open issues associated with this status update.
- property action_name¶
The name of the action to use for running or re-running the check.
- Type:
- run()¶
Run the tool associated with this status update.
This will emit the
status_update_request_run
signal, which extensions/integrations providing manual run support should listen to. They’re responsible for handling any filtering and configuration matching, as required.Changed in version 5.0.3: An associated integration config (if stored along with the status update) will be provided to the signal.
- __annotations__ = {'_integration_config': 'Optional[IntegrationConfig]', 'objects': 'ClassVar[StatusUpdateManager]'}¶
- change_description_id¶
- get_extra_data_json()¶
- get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)¶
- get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)¶
- get_state_display(*, field=<django.db.models.fields.CharField: state>)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- review_id¶
- review_request_id¶
- set_extra_data_json(json)¶
- user_id¶