EditTable

Base class: Table

Describe an editable table. Example:

table = EditTable(
    auto__model=Album,
    columns__name__field__include=True,
    columns__delete=EditColumn.delete(),
)
▼ Hide result
Toggle structure

Refinable members

action_class

Type: type[Action]

Cookbook:

How do I use custom classes for a table’s internal parts?

actions

Type: dict[str, Action]

Cookbook:

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

actions_below     (evaluated)

Type: bool

Default: False

Cookbook:

How do I render the table actions below the table?

actions_template     (evaluated)

Type: str | Template

Default: iommi/form/actions.html

Cookbook:

How do I render the table actions below the table?

after     (evaluated)

Type: 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

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: Form | None

Cookbook:

How do I enable bulk delete?

How do I make a custom bulk action?

bulk_container

Type: Fragment

Cookbook:

How do I run code after a bulk edit, or limit which rows it touches?

bulk_exclude     (evaluated)

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

Type: Namespace

Default: {}

Cookbook:

How do I run code after a bulk edit, or limit which rows it touches?

bulk_filter     (evaluated)

filters to apply to the QuerySet before performing the bulk operation

Type: Namespace

Default: {}

Cookbook:

How do I run code after a bulk edit, or limit which rows it touches?

cell     (evaluated)

Type: CellConfig

Cookbook:

How do I render a Table as divs?

cells_class

Type: type[Cells]

Cookbook:

How do I use custom classes for a table’s internal parts?

columns

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

Type: dict[str, Column]

Cookbook:

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

container     (evaluated)

Type: Fragment

Cookbook:

How do I insert arbitrary html into a Table?

create_form

Type: Form | None

Cookbook:

How do I configure the edit and create forms of an edit table?

default_sort_order

Type: str

Cookbook:

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

edit_actions

Type: dict[str, Action]

Cookbook:

How do I customize the Save and Add row actions?

edit_form

Type: Form

Cookbook:

How do I configure the edit and create forms of an edit 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[Form]

Cookbook:

How do I use a custom class for the columns/fields/filters of a component?

h_tag     (evaluated)

Type: Fragment | str

See title

include     (evaluated)

Type: bool

See include

invalid_form_message     (evaluated)

Type: str

Cookbook:

How do I customize the message shown for an invalid filter?

iommi_style

Type: str | Style | None

member_class

Type: type[Column]

Cookbook:

How do I use a custom class for the columns/fields/filters of a component?

model     (evaluated)

Type: type[Model] | None

Cookbook:

How do I read the model information iommi found?

outer     (evaluated)

Type: Fragment

Cookbook:

How do I insert arbitrary html into a Table?

page_class

Type: type[Page]

Cookbook:

How do I use custom classes for a table’s internal parts?

page_size     (evaluated)

Type: int

Default: 16

Cookbook:

How do you turn off pagination?

parent_form

Type: Form | None

Cookbook:

How do I nest an edit table inside a form?

parts

Type: Namespace

Cookbook:

How do you turn off pagination?

post_bulk_edit

Cookbook:

How do I run code after a bulk edit, or limit which rows it touches?

preprocess_row

Cookbook:

How do I render a Table as divs?

preprocess_row_for_create

Cookbook:

How do I set defaults on newly added rows?

preprocess_rows

Cookbook:

How do I render a Table as divs?

query

Type: Query | None

Cookbook:

How do I set an initial filter to a table?

query_class

Type: type[Query]

Cookbook:

How do I use a custom class for the columns/fields/filters of a component?

query_from_indexes

Type: bool

Cookbook:

How do I automatically create filters for indexed fields?

reorderable     (evaluated)

Type: bool | dict[str, Any] | None

Cookbook:

How do I let users drag to reorder rows?

row     (evaluated)

Type: RowConfig

Cookbook:

How do I customize the rendering of a row?

row_group_class

Type: type[RowGroup]

Cookbook:

How do I use custom classes for a table’s internal parts?

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

Cookbook:

How do I change what a column sorts by?

superheader

Type: Namespace

Cookbook:

How do I group columns under a superheader?

table_tag_wrapper     (evaluated)

Type: Fragment

Cookbook:

How do I wrap just the table tag (e.g. for responsive scrolling)?

tag     (evaluated)

Type: str

Default: table

See tag

tbody     (evaluated)

Type: Fragment

Cookbook:

How do I render a Table as divs?

template     (evaluated)

Type: str | Template

Default: iommi/table/table.html

See template

title     (evaluated)

Type: str | None

See title

Shortcuts

EditTable.div

Defaults

  • tag
    • div

  • tbody__tag
    • div

  • cell__tag
    • None

  • row__tag
    • div

  • header__template
    • None

Methods

bind

cells_for_rows_for_create

Yield a Cells instance for each create row sent from the client.

get_errors

is_valid

on_bind

on_refine_done

should_render_form_tag