EditTable
=========
Base class: :doc:`Table`
Describe an editable table. Example:
.. code-block:: python
table = EditTable(
auto__model=Album,
columns__name__field__include=True,
columns__delete=EditColumn.delete(),
)
.. raw:: html
▼ Hide result
Toggle structure
Refinable members
-----------------
`action_class`
^^^^^^^^^^^^^^
Type: `type[Action]`
Cookbook:
:ref:`table-internal-classes`
`actions`
^^^^^^^^^
Type: `dict[str, Action]`
Cookbook:
:ref:`custom-actions`
`actions_below` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `bool`
Default: `False`
Cookbook:
:ref:`actions-below-table`
`actions_template` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `str | Template`
Default: `iommi/form/actions.html`
Cookbook:
:ref:`actions-below-table`
`after` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `int | str`
See :ref:`after `
`assets`
^^^^^^^^
Type: `Namespace`
See :ref:`assets `
`attrs` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dict of strings to string/callable of HTML attributes to apply to the table
Type: :doc:`Attrs`
See :ref:`attributes `
`auto`
^^^^^^
Type: :doc:`TableAutoConfig`
See :ref:`auto `
Cookbook:
:ref:`fk-related-data-access`
:ref:`nested-fk`
`bulk` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `Form | None`
Cookbook:
:ref:`bulk-delete`
:ref:`custom-bulk-action`
`bulk_container`
^^^^^^^^^^^^^^^^
Type: :doc:`Fragment`
Cookbook:
:ref:`post-bulk-edit`
`bulk_exclude` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
exclude filters to apply to the `QuerySet` before performing the bulk operation
Type: `Namespace`
Default: `{}`
Cookbook:
:ref:`post-bulk-edit`
`bulk_filter` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
filters to apply to the `QuerySet` before performing the bulk operation
Type: `Namespace`
Default: `{}`
Cookbook:
:ref:`post-bulk-edit`
`cell` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `CellConfig`
Cookbook:
:ref:`table-as-div`
`cells_class`
^^^^^^^^^^^^^
Type: `type[Cells]`
Cookbook:
:ref:`table-internal-classes`
`columns`
^^^^^^^^^
(use this only when not using the declarative style) a list of Column objects
Type: `dict[str, Column]`
Cookbook:
:ref:`column-computed-data`
`container` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: :doc:`Fragment`
Cookbook:
:ref:`arbitrary-html`
`create_form`
^^^^^^^^^^^^^
Type: `Form | None`
Cookbook:
:ref:`edit-table-forms`
`default_sort_order`
^^^^^^^^^^^^^^^^^^^^
Type: `str`
Cookbook:
:ref:`default-sort-order`
`edit_actions`
^^^^^^^^^^^^^^
Type: `dict[str, Action]`
Cookbook:
:ref:`edit-table-actions`
`edit_form`
^^^^^^^^^^^
Type: :doc:`Form`
Cookbook:
:ref:`edit-table-forms`
`empty_message` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `str`
Cookbook:
:ref:`table-as-div`
`endpoints`
^^^^^^^^^^^
Type: `Namespace`
See :ref:`endpoints `
`extra`
^^^^^^^
Type: `dict[str, Any]`
See :ref:`extra `
`extra_evaluated`
^^^^^^^^^^^^^^^^^
Type: `dict[str, Any]`
See :ref:`extra `
Cookbook:
:ref:`table-as-csv`
`extra_params`
^^^^^^^^^^^^^^
See :ref:`extra_params `
`form_class`
^^^^^^^^^^^^
Type: `type[Form]`
Cookbook:
:ref:`custom-member-class`
`h_tag` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `Fragment | str`
See :ref:`title `
`header`
^^^^^^^^
Default: `Namespace()`
Cookbook:
:ref:`stop-header-render`
:ref:`turn-off-header`
`include` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `bool`
See :ref:`include `
`invalid_form_message` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `str`
Cookbook:
:ref:`table-invalid-form-message`
`iommi_style`
^^^^^^^^^^^^^
Type: `str | Style | None`
See :ref:`iommi_style `
`member_class`
^^^^^^^^^^^^^^
Type: `type[Column]`
Cookbook:
:ref:`custom-member-class`
`model` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `type[Model] | None`
Cookbook:
:ref:`table-model-introspection`
`outer` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: :doc:`Fragment`
Cookbook:
:ref:`arbitrary-html`
`page_class`
^^^^^^^^^^^^
Type: `type[Page]`
Cookbook:
:ref:`table-internal-classes`
`page_size` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `int`
Default: `16`
Cookbook:
:ref:`turn-off-pagination`
`parent_form`
^^^^^^^^^^^^^
Type: `Form | None`
Cookbook:
:ref:`edit-table-parent-form`
`parts`
^^^^^^^
Type: `Namespace`
Cookbook:
:ref:`turn-off-pagination`
`post_bulk_edit`
^^^^^^^^^^^^^^^^
Cookbook:
:ref:`post-bulk-edit`
`preprocess_row`
^^^^^^^^^^^^^^^^
Cookbook:
:ref:`table-as-div`
`preprocess_row_for_create`
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Cookbook:
:ref:`edit-table-preprocess-create`
`preprocess_rows`
^^^^^^^^^^^^^^^^^
Cookbook:
:ref:`table-as-div`
`query`
^^^^^^^
Type: `Query | None`
Cookbook:
:ref:`initial-filter`
`query_class`
^^^^^^^^^^^^^
Type: `type[Query]`
Cookbook:
:ref:`custom-member-class`
`query_from_indexes`
^^^^^^^^^^^^^^^^^^^^
Type: `bool`
Cookbook:
:ref:`query-from-indexes`
`reorderable` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `bool | dict[str, Any] | None`
Cookbook:
:ref:`edit-table-reorderable`
`row` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `RowConfig`
Cookbook:
:ref:`customize-rendering-row`
`row_group_class`
^^^^^^^^^^^^^^^^^
Type: `type[RowGroup]`
Cookbook:
:ref:`table-internal-classes`
`rows` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
a list or QuerySet of objects
Cookbook:
:ref:`additional-rows`
`sortable` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
set this to `False` to turn off sorting for all columns
Type: `bool`
Default: `True`
Cookbook:
:ref:`table-sorting`
`sorter`
^^^^^^^^
Cookbook:
:ref:`custom-sort-key`
`superheader`
^^^^^^^^^^^^^
Type: `Namespace`
Cookbook:
:ref:`superheader`
`table_tag_wrapper` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: :doc:`Fragment`
Cookbook:
:ref:`table-tag-wrapper`
`tag` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `str`
Default: `table`
See :ref:`tag `
`tbody` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: :doc:`Fragment`
Cookbook:
:ref:`table-as-div`
`template` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `str | Template`
Default: `iommi/table/table.html`
See :ref:`template `
`title` (:ref:`evaluated `)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Type: `str | None`
See :ref:`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`
^^^^^^^^^^^^^^^^^^^^^^^^