Jump to >


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

Revision history for a single file attachment.

This tracks multiple revisions of the same file attachment (for instance, when someone replaces a screenshot with an updated version).


Return a map from revision number to FileAttachment ID.

static compute_next_display_position(review_request)[source]

Compute the display position for a new FileAttachmentHistory.

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

A file associated with a review request.

Like diffs, a file can have comments associated with it. These comments are of type reviewboard.reviews.models.FileAttachmentComment.

property mimetype_handler[source]

Return the mimetype handler for this file.

property review_ui[source]

Return the review UI for this file.

property thumbnail[source]

Return the thumbnail for display.

property filename[source]

Return the filename for display purposes.

property display_name[source]

Return a display name for the file.

property icon_url[source]

Return the icon URL for this file.

property is_from_diff[source]

Return if this file attachment is associated with a diff.

property num_revisions[source]

Return the number of revisions of this attachment.


Return the ReviewRequest that this file is attached to.


Return all the comments made on this file attachment.


Return the absolute URL to download this file.


Returns whether or not the user has access to this FileAttachment.

This checks that the user has access to the LocalSite if the attachment is associated with a local site. This is only applicable for user owned file attachments.


Returns whether or not a user can modify this FileAttachment.

This checks that the user is either a superuser or the owner of the file attachment. This is only applicable for user owned file attachments.


Filter the list of file attachments to only return the latest revisions.


file_attachments (list of reviewboard.attachments.models.FileAttachment) – The file attachments to filter.


The list of file attachments that are the latest revisions in their respective histories.

Return type

list of reviewboard.attachments.models.FileAttachment