Table

Base class: Part

Describe a table. Example:

class AlbumTable(Table):
    name = Column()
    artist = Column()

    class Meta:
        sortable = False
▼ Hide result

Refinable members

action_class

Type: Type[iommi.action.Action]

actions

Type: Dict[str, iommi.action.Action]

Cookbook:

How do I add custom actions/links to a table?

actions_below     (evaluated)

Type: bool

Default: False

actions_template     (evaluated)

Type: Union[str, iommi._web_compat.Template]

Default: iommi/form/actions.html

after     (evaluated)

Type: Union[int, str]

See after

assets

Type: Namespace

See assets

attrs     (evaluated)

dict of strings to string/callable of HTML attributes to apply to the table

Type: Attrs

Cookbook:

How do I make a freetext search field?

auto

Type: TableAutoConfig

See auto

Cookbook:

How do I show nested foreign key relationships?

How do I access foreign key related data in a column?

bulk     (evaluated)

Type: Optional[iommi.form.Form]

Cookbook:

How do I make a custom bulk action?

How do I enable bulk delete?

bulk_container

Type: Fragment

bulk_exclude     (evaluated)

exclude filters to apply to the QuerySet before performing the bulk operation

Type: Namespace

Default: {}

bulk_filter     (evaluated)

filters to apply to the QuerySet before performing the bulk operation

Type: Namespace

Default: {}

cell     (evaluated)

Type: CellConfig

Cookbook:

How do I render a Table as divs?

cells_class

Type: Type[iommi.table.Cells]

columns

(use this only when not using the declarative style) a list of Column objects

Type: Dict[str, iommi.table.Column]

Cookbook:

How do I reorder columns?

How do I create a column based on computed data (i.e. a column not based on an attribute of the row)?

How do I make a link in a cell?

container     (evaluated)

Type: Fragment

Cookbook:

How do I insert arbitrary html into a Table?

default_sort_order

Cookbook:

How do I set the default sorting column of a table?

empty_message     (evaluated)

Type: str

Cookbook:

How do I render a Table as divs?

endpoints

Type: Namespace

extra

Type: Dict[str, Any]

See extra

extra_evaluated

Type: Dict[str, Any]

See extra

extra_params

form_class

Type: Type[iommi.form.Form]

h_tag     (evaluated)

Type: Union[iommi.fragment.Fragment, str]

See title

include     (evaluated)

Type: bool

See include

invalid_form_message     (evaluated)

Type: str

iommi_style

Type: str

member_class

model     (evaluated)

Type: Type[django.db.models.base.Model]

outer     (evaluated)

Type: Fragment

Cookbook:

How do I insert arbitrary html into a Table?

page_class

Type: Type[iommi.page.Page]

page_size     (evaluated)

Type: int

Default: 16

Cookbook:

How do you turn off pagination?

parts

Type: Namespace

post_bulk_edit

preprocess_row

Cookbook:

How do I render a Table as divs?

preprocess_rows

Cookbook:

How do I render a Table as divs?

query

Cookbook:

How do I set an initial filter to a table?

query_class

Type: Type[iommi.query.Query]

query_from_indexes

Type: bool

row     (evaluated)

Type: RowConfig

Cookbook:

How do I customize the rendering of a row?

row_group_class

Type: Type[iommi.table.RowGroup]

rows     (evaluated)

a list or QuerySet of objects

Cookbook:

How do I render additional rows?

sortable     (evaluated)

set this to False to turn off sorting for all columns

Type: bool

Default: True

Cookbook:

How do I turn off sorting? (on a column or table wide)

sorter

superheader

Type: Namespace

table_tag_wrapper     (evaluated)

Type: Fragment

tag     (evaluated)

Type: str

Default: table

See tag

Cookbook:

How do I render a Table as divs?

tbody     (evaluated)

Type: Fragment

Cookbook:

How do I render a Table as divs?

template     (evaluated)

Type: Union[str, iommi._web_compat.Template]

Default: iommi/table/table.html

See template

title     (evaluated)

Type: str

See title

Shortcuts

Table.div

Defaults

  • tag
    • div

  • tbody__tag
    • div

  • cell__tag
    • None

  • row__tag
    • div

  • header__template
    • None

Methods

as_view

bulk_queryset

Return the queryset that contains only the selected rows with

bulk_filter and bulk_exclude applied.

For use in post_handlers. Only valid when rows was a queryset.

cells_for_rows

Yield a Cells instance for each visible row on the screen.

get_visible_rows

on_bind

on_refine_done

own_evaluate_parameters

selection

Return the selected rows.

For use in post_handlers. It’s a queryset if rows is a queryset and a list otherwise. Unlike bulk_queryset neither bulk_filter nor bulk_exclude are applied.

should_render_form_tag

Class methods

columns_from_model