The horizon.tables.formset
Module¶
-
class
horizon.tables.formset.
FormsetCell
(*args, **kwargs)[source] Bases:
horizon.tables.base.Cell
A DataTable cell that knows about its field from the formset.
-
class
horizon.tables.formset.
FormsetDataTable
(*args, **kwargs)[source] Bases:
horizon.tables.formset.FormsetDataTableMixin
,horizon.tables.base.DataTable
A DataTable with support for Django Formsets.
Note that
horizon.tables.DataTableOptions.row_class
andhorizon.tables.DataTaleOptions.cell_class
are overwritten in this class, so setting them inMeta
has no effect.-
formset_class
¶ A class made with
django.forms.formsets.formset_factory
containing the definition of the formset to use with this data table.The columns that are named the same as the formset fields will be replaced with form widgets in the table. Any hidden fields from the formset will also be included. The fields that are not hidden and don’t correspond to any column will not be included in the form.
-
base_actions
= OrderedDict()
-
base_columns
= OrderedDict()
-
-
class
horizon.tables.formset.
FormsetDataTableMixin
(*args, **kwargs)[source] Bases:
object
A mixin for DataTable to support Django Formsets.
This works the same as the
FormsetDataTable
below, but can be used to add to existing DataTable subclasses.-
formset_class
= None
-
get_empty_row
()[source] Return a row with no data, for adding at the end of the table.
-
get_formset
()[source] Provide the formset corresponding to this DataTable.
Use this to validate the formset and to get the submitted data back.
-
get_object_id
(datum)[source]
-
get_required_columns
()[source] Lists names of columns that have required fields.
-
get_rows
()[source] Return the row data for this table broken out by columns.
The row objects get an additional
form
parameter, with the formset form corresponding to that row.
-