reviewboard.reviews.views.attachments¶
Views for reviewing file attachments (and legacy screenshots).
- class DownloadFileAttachmentView(**kwargs)[source]¶
Bases:
_FileAttachmentViewMixin
,ReviewRequestViewMixin
,View
Redirects the request to the file attachment on the storage backend.
This will check first for an accessible file attachment matching the URL and the user’s access to the review request and draft. If found, the client will be redirected to the location of the file attachment in the storage backend.
The redirected file may or may not be cacheable, and may only be accessible temporarily, depending on the backend.
New in version 7.0.
- get(request: HttpRequest, *, file_attachment_id: int, **kwargs) HttpResponse [source]¶
Handle HTTP GET requests for this view.
- Parameters:
request (
django.http.HttpRequest
) – The HTTP request from the client.file_attachment_id (
int
) – The revision of the file attachment to download the file from.**kwargs (
dict
) – Keyword arguments passed to the handler.
- Returns:
The HTTP response to send to the client.
- Return type:
- __annotations__ = {}¶
- class ReviewFileAttachmentView(**kwargs)[source]¶
Bases:
_FileAttachmentViewMixin
,ReviewRequestViewMixin
,UserProfileRequiredViewMixin
,View
Displays a file attachment with a review UI.
- get(request: HttpRequest, file_attachment_id: int, file_attachment_diff_id: Optional[int] = None, *args, **kwargs) HttpResponse [source]¶
Handle a HTTP GET request.
- Parameters:
request (
django.http.HttpRequest
) – The HTTP request from the client.file_attachment_id (
int
) – The ID of the file attachment to review.file_attachment_diff_id (
int
, optional) – The ID of the file attachment to diff against.*args (
tuple
) – Positional arguments passed to the handler.**kwargs (
dict
) – Keyword arguments passed to the handler.
- Returns:
The resulting HTTP response from the handler.
- Return type:
- __annotations__ = {}¶
- class ReviewScreenshotView(**kwargs)[source]¶
Bases:
ReviewRequestViewMixin
,UserProfileRequiredViewMixin
,View
Displays a review UI for a screenshot.
Screenshots are a legacy feature, predating file attachments. While they can’t be created anymore, this view does allow for reviewing screenshots uploaded in old versions.
- get(request: HttpRequest, screenshot_id: int, *args, **kwargs) HttpResponse [source]¶
Handle a HTTP GET request.
- Parameters:
request (
django.http.HttpRequest
) – The HTTP request from the client.screenshot_id (
int
) – The ID of the screenshot to review.*args (
tuple
) – Positional arguments passed to the handler.**kwargs (
dict
) – Keyword arguments passed to the handler.
- Returns:
The resulting HTTP response from the handler.
- Return type:
- __annotations__ = {}¶