Jump to >

reviewboard.datagrids.columns

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

Bases: djblets.datagrid.grids.Column

Indicates if an item is starred.

This is the base class for all columns that deal with starring items.

The star is interactive, allowing the user to star or unstar the item.

__init__(*args, **kwargs)[source]

Initialize the column.

setup_state(state)[source]

Set up the state for this column.

render_data(state, obj)[source]

Return the rendered contents of the column.

class UsernameColumn(label='Username', user_relation=[], *args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

A column for showing a username and the user’s avatar.

The username and avatar will link to the user’s profile page and will show basic profile information when hovering over the link.

When constructing an instance of this column, the relation between the object being represented in the datagrid and the user can be specified as a tuple or list of field names forming a path to the user field.

AVATAR_SIZE = 24[source]
__init__(label='Username', user_relation=[], *args, **kwargs)[source]

Initialize the column.

Parameters
  • label (unicode, optional) – The label for the column.

  • user_relation (list of unicode, optional) – A list of fields forming a relation path to the user. This can be left blank if representing the user.

  • *args (tuple) – Additional positional arguments to pass to the column.

  • **kwargs (dict) – Additional keyword arguments to pass to the column.

get_user(obj)[source]

Return the user associated with this object.

Parameters

obj (object) – The object provided to the column.

Returns

The resulting user.

Return type

django.contrib.auth.models.User

render_data(state, obj)[source]

Render the user’s name and avatar as HTML.

Parameters
Returns

The HTML for the column.

Return type

django.utils.safestring.SafeText

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

This will select fields for the user and the user’s profile, to help with query performance.

Parameters
Returns

The resulting queryset.

Return type

django.db.models.query.QuerySet

__annotations__ = {}
class FullNameColumn(label=None, id=None, detailed_label=None, detailed_label_html=None, field_name=None, db_field=None, image_url=None, image_class=None, image_width=None, image_height=None, image_alt='', shrink=False, expand=False, sortable=False, default_sort_dir=0, link=False, link_func=None, link_css_class=None, cell_clickable=False, css_class='')[source]

Bases: djblets.datagrid.grids.Column

Shows the full name of the user when appropriate.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

This will select fields for the user and the user’s profile, to help with query performance.

Parameters
Returns

The resulting queryset.

Return type

django.db.models.query.QuerySet

render_data(state, user)[source]

Render the full name, or blank if not visible to the user.

Parameters
Returns

Either the full name (if visible to the user) or an empty string.

Return type

unicode

__annotations__ = {}
class BugsColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the list of bugs specified on a review request.

The list of bugs will be linked to the bug tracker, if a bug tracker was configured for the repository the review request’s change is on.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, review_request)[source]

Return the rendered contents of the column.

__annotations__ = {}
class ReviewRequestCheckboxColumn(checkbox_name='select', shrink=True, show_checkbox_header=True, detailed_label='Select Rows', *args, **kwargs)[source]

Bases: djblets.datagrid.grids.CheckboxColumn

A column containing a check-box.

render_data(state, obj)[source]

Return the rendered contents of the column.

__annotations__ = {}
class DateTimeSinceColumn(label, format=None, sortable=True, timezone=<UTC>, *args, **kwargs)[source]

Bases: djblets.datagrid.grids.DateTimeColumn

Displays how long it has been since a given date/time.

These columns will dynamically update as the page is shown, so that the number of minutes, hours, days, etc. ago is correct.

render_data(state, obj)[source]

Return the rendered contents of the column.

__annotations__ = {}
class DiffUpdatedColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.DateTimeColumn

Shows the date/time that the diff was last updated.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, obj)[source]

Return the rendered contents of the column.

__annotations__ = {}
class DiffUpdatedSinceColumn(*args, **kwargs)[source]

Bases: reviewboard.datagrids.columns.DateTimeSinceColumn

Shows the elapsed time since the diff was last updated.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, obj)[source]

Return the rendered contents of the column.

__annotations__ = {}
class GroupMemberCountColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the number of users that are part of a review group.

__init__(*args, **kwargs)[source]

Initialize the column.

render_data(state, group)[source]

Return the rendered contents of the column.

Return the link to the object in the column.

__annotations__ = {}
class GroupsColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the list of groups requested to review the review request.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, review_request)[source]

Return the rendered contents of the column.

__annotations__ = {}
class MyCommentsColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows if the current user has reviewed the review request.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, review_request)[source]

Return the rendered contents of the column.

__annotations__ = {}
class NewUpdatesColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Indicates if there are new updates on a review request.

This will show an icon if the review request has had any new updates or reviews since the user last saw it.

__init__(*args, **kwargs)[source]

Initialize the column.

render_data(state, review_request)[source]

Return the rendered contents of the column.

__annotations__ = {}
class PendingCountColumn(label=None, id=None, detailed_label=None, detailed_label_html=None, field_name=None, db_field=None, image_url=None, image_class=None, image_width=None, image_height=None, image_alt='', shrink=False, expand=False, sortable=False, default_sort_dir=0, link=False, link_func=None, link_css_class=None, cell_clickable=False, css_class='')[source]

Bases: djblets.datagrid.grids.Column

Shows the pending number of review requests for a user or group.

This will show the pending number of review requests for the given review group or user. It only applies to group or user lists.

render_data(state, obj)[source]

Return the rendered contents of the column.

__annotations__ = {}
class PeopleColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the list of people requested to review the review request.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, review_request)[source]

Return the rendered contents of the column.

__annotations__ = {}
class RepositoryColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the name of the repository the review request’s change is on.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, obj)[source]

Return the rendered contents of the column.

__annotations__ = {}
class ReviewCountColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the number of published reviews for a review request.

__init__(*args, **kwargs)[source]

Initialize the column.

render_data(state, review_request)[source]

Return the rendered contents of the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

Return the link to the object in the column.

__annotations__ = {}
class ReviewGroupStarColumn(*args, **kwargs)[source]

Bases: reviewboard.datagrids.columns.BaseStarColumn

Indicates if a review group is starred.

The star is interactive, allowing the user to star or unstar the group.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

__annotations__ = {}
class ReviewRequestIDColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Displays the ID of the review request.

__init__(*args, **kwargs)[source]

Initialize the column.

get_sort_field(state)[source]

Return the model field for sorting this column.

render_data(state, review_request)[source]

Return the rendered contents of the column.

__annotations__ = {}
class ReviewRequestStarColumn(*args, **kwargs)[source]

Bases: reviewboard.datagrids.columns.BaseStarColumn

Indicates if a review request is starred.

The star is interactive, allowing the user to star or unstar the review request.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

__annotations__ = {}
class ShipItColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the “Ship It” and issue counts for a review request.

If there are any issues still to resolve or verify, this will instead show information on those issues. Otherwise, it will show information on the number of Ship It! reviews filed.

The following is the order of priority in which information is shown:

  1. Open issues with issues requiring verification

  2. Open issues

  3. Issues requiring verification

  4. Ship It! counts

If showing a Ship It!, and if the latest review is older than the last update on the review request, the Ship It! will be marked as stale, helping visually indicate that it may need a re-review. The ARIA label reflects this as well.

Changed in version 5.0:

  • Added ARIA attributes for the displayed output.

  • Ship It! counts are now shown as stale if older than the latest update to the review request.

__init__(*args, **kwargs)[source]

Initialize the column.

Parameters
  • *args (tuple) – Additional arguments to pass to the parent constructor.

  • **kwargs (dict) – Additional keyword arguments to pass to the parent constructor.

render_data(state, review_request)[source]

Return the rendered contents of the column.

Parameters
Returns

The rendered HTML for the column.

Return type

django.utils.safestring.SafeText

__annotations__ = {}
class SummaryColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Shows the summary of a review request.

This will also prepend the draft/submitted/discarded state, if any, to the summary.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, review_request)[source]

Return the rendered contents of the column.

Parameters
Returns

The rendered column.

Return type

django.utils.safestring.SafeText

__annotations__ = {}
class ReviewSummaryColumn(*args, **kwargs)[source]

Bases: reviewboard.datagrids.columns.SummaryColumn

Shows the summary of the review request of a review.

This does not (yet) prepend the draft/submitted/discarded state, if any, to the summary.

__init__(*args, **kwargs)[source]

Initialize the column.

render_data(state, review)[source]

Return the rendered contents of the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

__annotations__ = {}
class ToMeColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Indicates if the user is requested to review the change.

This will show an indicator if the user is on the Target People reviewers list.

__init__(*args, **kwargs)[source]

Initialize the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

render_data(state, review_request)[source]

Return the rendered contents of the column.

__annotations__ = {}
class DiffSizeColumn(*args, **kwargs)[source]

Bases: djblets.datagrid.grids.Column

Indicates line add/delete counts for the latest diffset.

__init__(*args, **kwargs)[source]

Initialize the column.

render_data(state, review_request)[source]

Return the rendered contents of the column.

augment_queryset(state, queryset)[source]

Add additional queries to the queryset.

This will prefetch the diffsets and filediffs needed to perform the line calculations.

Parameters
Returns

The resulting queryset.

Return type

django.db.models.query.QuerySet

__annotations__ = {}