web.utils.columns module

Module with custom columns classes.

class web.utils.columns.CheckboxColumn(*args, **kwargs)[source]

Bases: Column

Column with select checkboxes matching the templates.

Parameters:
  • args (Any)

  • kwargs (Any)

__init__(*args, **kwargs)[source]
Parameters:
Return type:

None

render(record)[source]

Renders the select checkbox for the record.

Parameters:

record (Model) – The model record.

Return type:

str

Returns:

Html checkbox for selecting the instance.

class web.utils.columns.IsFavoriteColumn(verbose_name=None, accessor=None, default=None, visible=True, orderable=None, attrs=None, order_by=None, empty_values=None, localize=None, footer=None, exclude_from_export=False, linkify=False, initial_sort_descending=False)[source]

Bases: Column

Column for the is_favorite field with the badge.

render(record)[source]

Renders the value in form of a badge.

Parameters:

record (Model) – The model with the is_favorite field.

Return type:

str

Returns:

Html badge for the favorite status.

class web.utils.columns.IsHealthyColumn(*args, **kwargs)[source]

Bases: Column

Column for the is_healthy field with the badge.

Parameters:
  • args (Any)

  • kwargs (Any)

__init__(*args, **kwargs)[source]
Parameters:
Return type:

None

render(value)[source]

Renders the value in form of a badge.

Parameters:

value (bool | None) – The value of the is_healthy field.

Return type:

str

Returns:

Html badge for the health status.