Table

Base class: Part

Describe a table. Example:

class FooTable(Table):
    a = Column()
    b = Column()

    class Meta:
        sortable = False
        attrs__style = 'background: green'

Refinable members

  • action_class

  • actions_template

  • after

  • attrs

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

    Type: Attrs

  • bulk

    Type: Namespace

  • bulk_exclude

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

    Type: Namespace

  • bulk_filter

    filters to apply to the QuerySet before performing the bulk operation

    Type: Namespace

  • cell

    Type: CellConfig

  • columns

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

  • default_sort_order

  • endpoints

    Type: Namespace

  • extra

  • extra_evaluated

  • form_class

  • h_tag

    Type: Fragment

  • header

  • include

    Type: bool

  • iommi_style

    Type: str

  • member_class

  • model

  • page_class

  • page_size

    Type: int

  • paginator

    Type: Paginator

  • post_bulk_edit

  • preprocess_row

  • preprocess_rows

  • query_class

  • query_from_indexes

    Type: bool

  • row

    Type: RowConfig

  • rows

    a list or QuerySet of objects

  • sortable

    set this to False to turn off sorting for all columns

    Type: bool

  • superheader

    Type: Namespace

  • tag

    Type: str

  • template

  • title

    Type: Fragment

Defaults

  • actions_template
    • iommi/form/actions.html
  • cell__tag
    • td
  • h_tag__call_target
    • iommi.page.Header
  • header__template
    • iommi/table/table_header_rows.html
  • page_size
    • 40
  • paginator__call_target
    • iommi.table.Paginator
  • row__attrs__data-pk
    • lambda row, **_: getattr(row, 'pk', None)}
  • row__tag
    • tr
  • row__template
    • None
  • sortable
    • True
  • superheader__attrs__class__superheader
    • True
  • superheader__template
    • iommi/table/header.html
  • tag
    • table
  • template
    • iommi/table/table.html