The horizon.tabs.views Module

class horizon.tabs.views.TabView[source]

Bases: horizon.views.HorizonTemplateView

A generic class-based view for displaying a horizon.tabs.TabGroup.

This view handles selecting specific tabs and deals with AJAX requests gracefully.

tab_group_class

The only required attribute for TabView. It should be a class which inherits from horizon.tabs.TabGroup.

get(request, *args, **kwargs)[source]
get_context_data(**kwargs)[source]

Adds the tab_group variable to the context data.

get_tabs(request, **kwargs)[source]

Returns the initialized tab group for this view.

handle_tabbed_response(tab_group, context)[source]

Sends back an AJAX-appropriate response for the tab group if required, otherwise renders the response as normal.

render_to_response(*args, **kwargs)[source]
tab_group_class = None
class horizon.tabs.views.TabbedTableView(*args, **kwargs)[source]

Bases: horizon.tables.views.MultiTableMixin, horizon.tabs.views.TabView

get(request, *args, **kwargs)[source]
get_tables()[source]

A no-op on this class. Tables are handled at the tab level.

handle_table(table_dict)[source]

For the given dict containing a DataTable and a TableTab instance, it loads the table data for that tab and calls the table’s maybe_handle() method. The return value will be the result of maybe_handle.

load_tabs()[source]

Loads the tab group, and compiles the table instances for each table attached to any horizon.tabs.TableTab instances on the tab group. This step is necessary before processing any tab or table actions.

post(request, *args, **kwargs)[source]

Previous topic

The horizon.tabs Module

Next topic

The horizon.tabs.base Module

Project Source

This Page