The horizon.tables.views ModuleΒΆ

class horizon.tables.views.DataTableView(*args, **kwargs)[source]

Bases: horizon.tables.views.MultiTableView

A class-based generic view to handle basic DataTable processing.

Three steps are required to use this view: set the table_class attribute with the desired DataTable class; define a get_data method which returns a set of data for the table; and specify a template for the template_name attribute.

Optionally, you can override the has_more_data method to trigger pagination handling for APIs that support it.

DataTableView.context_object_name = 'table'
DataTableView.get_context_data(**kwargs)[source]
DataTableView.get_data()[source]
DataTableView.get_table()[source]
DataTableView.get_tables()[source]
DataTableView.table_class = None
class horizon.tables.views.MultiTableMixin(*args, **kwargs)[source]

Bases: object

A generic mixin which provides methods for handling DataTables.

MultiTableMixin.get_context_data(**kwargs)[source]
MultiTableMixin.get_tables()[source]
MultiTableMixin.handle_table(table)[source]
MultiTableMixin.has_more_data(table)[source]
class horizon.tables.views.MultiTableView(*args, **kwargs)[source]

Bases: horizon.tables.views.MultiTableMixin, django.views.generic.base.TemplateView

A class-based generic view to handle the display and processing of multiple DataTable classes in a single view.

Three steps are required to use this view: set the table_classes attribute with a tuple of the desired DataTable classes; define a get_{{ table_name }}_data method for each table class which returns a set of data for that table; and specify a template for the template_name attribute.

MultiTableView.construct_tables()[source]
MultiTableView.get(request, *args, **kwargs)[source]
MultiTableView.post(request, *args, **kwargs)[source]

Previous topic

The horizon.tables.actions Module

Next topic

The horizon.templatetags.truncate_filter Module

This Page