Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 6f61f4fc58119d17ef9d99939eb417b3 > files > 564

python-django-horizon-doc-2012.2.3-1.fc18.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Horizon Tabs and TabGroups &mdash; Horizon 2012.2.3 documentation</title>
    
    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/tweaks.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2012.2.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/jquery.tweet.js"></script>
    <link rel="top" title="Horizon 2012.2.3 documentation" href="../index.html" />
    <link rel="next" title="Horizon Forms" href="forms.html" />
    <link rel="prev" title="Horizon DataTables" href="tables.html" /> 
  </head>
  <body>
  <div id="header">
    <h1 id="logo"><a href="http://www.openstack.org/">OpenStack</a></h1>
    <ul id="navigation">
      <li><a href="http://www.openstack.org/" title="Go to the Home page" class="link">Home</a></li>
      <li><a href="http://www.openstack.org/projects/" title="Go to the OpenStack Projects page">Projects</a></li>
      <li><a href="http://www.openstack.org/user-stories/" title="Go to the User Stories page" class="link">User Stories</a></li>
      <li><a href="http://www.openstack.org/community/" title="Go to the Community page" class="link">Community</a></li>
      <li><a href="http://www.openstack.org/blog/" title="Go to the OpenStack Blog">Blog</a></li>
      <li><a href="http://wiki.openstack.org/" title="Go to the OpenStack Wiki">Wiki</a></li>
      <li><a href="http://docs.openstack.org/" title="Go to OpenStack Documentation" class="current">Documentation</a></li>
    </ul>
  </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-horizon.tabs">
<span id="horizon-tabs-and-tabgroups"></span><h1>Horizon Tabs and TabGroups<a class="headerlink" href="#module-horizon.tabs" title="Permalink to this headline">¶</a></h1>
<p>Horizon includes a set of reusable components for programmatically
building tabbed interfaces with fancy features like dynamic AJAX loading
and nearly effortless templating and styling.</p>
<div class="section" id="tab-groups">
<h2>Tab Groups<a class="headerlink" href="#tab-groups" title="Permalink to this headline">¶</a></h2>
<p>For any tabbed interface, your fundamental element is the tab group which
contains all your tabs. This class provides a dead-simple API for building
tab groups and encapsulates all the necessary logic behind the scenes.</p>
<dl class="class">
<dt id="horizon.tabs.TabGroup">
<em class="property">class </em><tt class="descclassname">horizon.tabs.</tt><tt class="descname">TabGroup</tt><big>(</big><em>request</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup" title="Permalink to this definition">¶</a></dt>
<dd><p>A container class which knows how to manage and render
<a class="reference internal" href="#horizon.tabs.Tab" title="horizon.tabs.Tab"><tt class="xref py py-class docutils literal"><span class="pre">Tab</span></tt></a> objects.</p>
<dl class="attribute">
<dt id="horizon.tabs.TabGroup.slug">
<tt class="descname">slug</tt><a class="headerlink" href="#horizon.tabs.TabGroup.slug" title="Permalink to this definition">¶</a></dt>
<dd><p>The URL slug and pseudo-unique identifier for this tab group.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.TabGroup.template_name">
<tt class="descname">template_name</tt><a class="headerlink" href="#horizon.tabs.TabGroup.template_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the template which will be used to render this tab group.
Default: <tt class="docutils literal"><span class="pre">&quot;horizon/common/_tab_group.html&quot;</span></tt></p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.TabGroup.sticky">
<tt class="descname">sticky</tt><a class="headerlink" href="#horizon.tabs.TabGroup.sticky" title="Permalink to this definition">¶</a></dt>
<dd><p>Boolean to control whether the active tab state should be stored
across requests for a given user. (State storage is all done
client-side.)</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.TabGroup.param_name">
<tt class="descname">param_name</tt><a class="headerlink" href="#horizon.tabs.TabGroup.param_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the GET request parameter which will be used when
requesting specific tab data. Default: <tt class="docutils literal"><span class="pre">tab</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.TabGroup.classes">
<tt class="descname">classes</tt><a class="headerlink" href="#horizon.tabs.TabGroup.classes" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of CSS classes which should be displayed on this tab group.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.TabGroup.attrs">
<tt class="descname">attrs</tt><a class="headerlink" href="#horizon.tabs.TabGroup.attrs" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary of HTML attributes which should be rendered into the
markup for this tab group.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.TabGroup.selected">
<tt class="descname">selected</tt><a class="headerlink" href="#horizon.tabs.TabGroup.selected" title="Permalink to this definition">¶</a></dt>
<dd><p>Read-only property which is set to the instance of the
currently-selected tab if there is one, otherwise <tt class="docutils literal"><span class="pre">None</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.TabGroup.active">
<tt class="descname">active</tt><a class="headerlink" href="#horizon.tabs.TabGroup.active" title="Permalink to this definition">¶</a></dt>
<dd><p>Read-only property which is set to the value of the current active tab.
This may not be the same as the value of <tt class="docutils literal"><span class="pre">selected</span></tt> if no
specific tab was requested via the <tt class="docutils literal"><span class="pre">GET</span></tt> parameter.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.get_default_classes">
<tt class="descname">get_default_classes</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.get_default_classes" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of the default classes for the tab group. Defaults to
<tt class="docutils literal"><span class="pre">[&quot;nav&quot;,</span> <span class="pre">&quot;nav-tabs&quot;,</span> <span class="pre">&quot;ajax-tabs&quot;]</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.get_id">
<tt class="descname">get_id</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.get_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the id for this tab group. Defaults to the value of the tab
group&#8217;s <a class="reference internal" href="#horizon.tabs.Tab.slug" title="horizon.tabs.Tab.slug"><tt class="xref py py-attr docutils literal"><span class="pre">horizon.tabs.Tab.slug</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.get_selected_tab">
<tt class="descname">get_selected_tab</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.get_selected_tab" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the tab specific by the GET request parameter.</p>
<p>In the event that there is no GET request parameter, the value
of the query parameter is invalid, or the tab is not allowed/enabled,
the return value of this function is None.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.get_tab">
<tt class="descname">get_tab</tt><big>(</big><em>tab_name</em>, <em>allow_disabled=False</em><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.get_tab" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a specific tab from this tab group.</p>
<p>If the tab is not allowed or not enabled this method returns <tt class="docutils literal"><span class="pre">None</span></tt>.</p>
<p>If the tab is disabled but you wish to return it anyway, you can pass
<tt class="docutils literal"><span class="pre">True</span></tt> to the allow_disabled argument.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.get_tabs">
<tt class="descname">get_tabs</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.get_tabs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of the allowed tabs for this tab group.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.load_tab_data">
<tt class="descname">load_tab_data</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.load_tab_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Preload all data that for the tabs that will be displayed.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.render">
<tt class="descname">render</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.render" title="Permalink to this definition">¶</a></dt>
<dd><p>Renders the HTML output for this tab group.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabGroup.tabs_not_available">
<tt class="descname">tabs_not_available</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabGroup.tabs_not_available" title="Permalink to this definition">¶</a></dt>
<dd><p>In the event that no tabs are either allowed or enabled, this method
is the fallback handler. By default it&#8217;s a no-op, but it exists
to make redirecting or raising exceptions possible for subclasses.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="tabs">
<h2>Tabs<a class="headerlink" href="#tabs" title="Permalink to this headline">¶</a></h2>
<p>The tab itself is the discrete unit for a tab group, representing one
view of data.</p>
<dl class="class">
<dt id="horizon.tabs.Tab">
<em class="property">class </em><tt class="descclassname">horizon.tabs.</tt><tt class="descname">Tab</tt><big>(</big><em>tab_group</em>, <em>request=None</em><big>)</big><a class="headerlink" href="#horizon.tabs.Tab" title="Permalink to this definition">¶</a></dt>
<dd><p>A reusable interface for constructing a tab within a
<a class="reference internal" href="#horizon.tabs.TabGroup" title="horizon.tabs.TabGroup"><tt class="xref py py-class docutils literal"><span class="pre">TabGroup</span></tt></a>.</p>
<dl class="attribute">
<dt id="horizon.tabs.Tab.name">
<tt class="descname">name</tt><a class="headerlink" href="#horizon.tabs.Tab.name" title="Permalink to this definition">¶</a></dt>
<dd><p>The display name for the tab which will be rendered as the text for
the tab element in the HTML. Required.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.Tab.slug">
<tt class="descname">slug</tt><a class="headerlink" href="#horizon.tabs.Tab.slug" title="Permalink to this definition">¶</a></dt>
<dd><p>The URL slug and id attribute for the tab. This should be unique for
a given tab group. Required.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.Tab.preload">
<tt class="descname">preload</tt><a class="headerlink" href="#horizon.tabs.Tab.preload" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines whether the contents of the tab should be rendered into
the page&#8217;s HTML when the tab group is rendered, or whether it should
be loaded dynamically when the tab is selected. Default: <tt class="docutils literal"><span class="pre">True</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.Tab.classes">
<tt class="descname">classes</tt><a class="headerlink" href="#horizon.tabs.Tab.classes" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of CSS classes which should be displayed on this tab.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.Tab.attrs">
<tt class="descname">attrs</tt><a class="headerlink" href="#horizon.tabs.Tab.attrs" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary of HTML attributes which should be rendered into the
markup for this tab.</p>
</dd></dl>

<dl class="attribute">
<dt id="horizon.tabs.Tab.load">
<tt class="descname">load</tt><a class="headerlink" href="#horizon.tabs.Tab.load" title="Permalink to this definition">¶</a></dt>
<dd><p>Read-only access to determine whether or not this tab&#8217;s data should
be loaded immediately.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.allowed">
<tt class="descname">allowed</tt><big>(</big><em>request</em><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.allowed" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines whether or not the tab is displayed.</p>
<p>Tab instances can override this method to specify conditions under
which this tab should not be shown at all by returning <tt class="docutils literal"><span class="pre">False</span></tt>.</p>
<p>The default behavior is to return <tt class="docutils literal"><span class="pre">True</span></tt> for all cases.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.enabled">
<tt class="descname">enabled</tt><big>(</big><em>request</em><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.enabled" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines whether or not the tab should be accessible
(e.g. be rendered into the HTML on load and respond to a click event).</p>
<p>If a tab returns <tt class="docutils literal"><span class="pre">False</span></tt> from <tt class="docutils literal"><span class="pre">enabled</span></tt> it will ignore the value
of <tt class="docutils literal"><span class="pre">preload</span></tt> and only render the HTML of the tab after being clicked.</p>
<p>The default behavior is to return <tt class="docutils literal"><span class="pre">True</span></tt> for all cases.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.get_context_data">
<tt class="descname">get_context_data</tt><big>(</big><em>request</em><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.get_context_data" title="Permalink to this definition">¶</a></dt>
<dd><p>This method should return a dictionary of context data used to render
the tab. Required.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.get_default_classes">
<tt class="descname">get_default_classes</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.get_default_classes" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of the default classes for the tab. Defaults to
and empty list (<tt class="docutils literal"><span class="pre">[]</span></tt>), however additional classes may be added
depending on the state of the tab as follows:</p>
<p>If the tab is the active tab for the tab group, in which
the class <tt class="docutils literal"><span class="pre">&quot;active&quot;</span></tt> will be added.</p>
<p>If the tab is not enabled, the classes the class <tt class="docutils literal"><span class="pre">&quot;disabled&quot;</span></tt>
will be added.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.get_id">
<tt class="descname">get_id</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.get_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the id for this tab. Defaults to
<tt class="docutils literal"><span class="pre">&quot;{{</span> <span class="pre">tab_group.slug</span> <span class="pre">}}__{{</span> <span class="pre">tab.slug</span> <span class="pre">}}&quot;</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.get_template_name">
<tt class="descname">get_template_name</tt><big>(</big><em>request</em><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.get_template_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the name of the template to be used for rendering this tab.</p>
<p>By default it returns the value of the <tt class="docutils literal"><span class="pre">template_name</span></tt> attribute
on the <tt class="docutils literal"><span class="pre">Tab</span></tt> class.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.is_active">
<tt class="descname">is_active</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.is_active" title="Permalink to this definition">¶</a></dt>
<dd><p>Method to access whether or not this tab is the active tab.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.Tab.render">
<tt class="descname">render</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.Tab.render" title="Permalink to this definition">¶</a></dt>
<dd><p>Renders the tab to HTML using the
<a class="reference internal" href="#horizon.tabs.Tab.get_context_data" title="horizon.tabs.Tab.get_context_data"><tt class="xref py py-meth docutils literal"><span class="pre">get_context_data()</span></tt></a> method and
the <a class="reference internal" href="#horizon.tabs.Tab.get_template_name" title="horizon.tabs.Tab.get_template_name"><tt class="xref py py-meth docutils literal"><span class="pre">get_template_name()</span></tt></a> method.</p>
<p>If <a class="reference internal" href="#horizon.tabs.Tab.preload" title="horizon.tabs.Tab.preload"><tt class="xref py py-attr docutils literal"><span class="pre">preload</span></tt></a> is <tt class="docutils literal"><span class="pre">False</span></tt> and <tt class="docutils literal"><span class="pre">force_load</span></tt>
is not <tt class="docutils literal"><span class="pre">True</span></tt>, or
either <a class="reference internal" href="#horizon.tabs.Tab.allowed" title="horizon.tabs.Tab.allowed"><tt class="xref py py-meth docutils literal"><span class="pre">allowed()</span></tt></a> or
<a class="reference internal" href="#horizon.tabs.Tab.enabled" title="horizon.tabs.Tab.enabled"><tt class="xref py py-meth docutils literal"><span class="pre">enabled()</span></tt></a> returns <tt class="docutils literal"><span class="pre">False</span></tt> this method will
return an empty string.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="horizon.tabs.TableTab">
<em class="property">class </em><tt class="descclassname">horizon.tabs.</tt><tt class="descname">TableTab</tt><big>(</big><em>tab_group</em>, <em>request</em><big>)</big><a class="headerlink" href="#horizon.tabs.TableTab" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference internal" href="#horizon.tabs.Tab" title="horizon.tabs.Tab"><tt class="xref py py-class docutils literal"><span class="pre">Tab</span></tt></a> class which knows how to deal with
<a class="reference internal" href="tables.html#horizon.tables.DataTable" title="horizon.tables.DataTable"><tt class="xref py py-class docutils literal"><span class="pre">DataTable</span></tt></a> classes rendered inside of it.</p>
<p>This distinct class is required due to the complexity involved in handling
both dynamic tab loading, dynamic table updating and table actions all
within one view.</p>
<dl class="attribute">
<dt id="horizon.tabs.TableTab.table_classes">
<tt class="descname">table_classes</tt><a class="headerlink" href="#horizon.tabs.TableTab.table_classes" title="Permalink to this definition">¶</a></dt>
<dd><p>An iterable containing the <a class="reference internal" href="tables.html#horizon.tables.DataTable" title="horizon.tables.DataTable"><tt class="xref py py-class docutils literal"><span class="pre">DataTable</span></tt></a> classes
which this tab will contain. Equivalent to the
<tt class="xref py py-attr docutils literal"><span class="pre">table_classes</span></tt> attribute on
<a class="reference internal" href="tables.html#horizon.tables.MultiTableView" title="horizon.tables.MultiTableView"><tt class="xref py py-class docutils literal"><span class="pre">MultiTableView</span></tt></a>. For each table class you
need to define a corresponding <tt class="docutils literal"><span class="pre">get_{{</span> <span class="pre">table_name</span> <span class="pre">}}_data</span></tt> method
as with <a class="reference internal" href="tables.html#horizon.tables.MultiTableView" title="horizon.tables.MultiTableView"><tt class="xref py py-class docutils literal"><span class="pre">MultiTableView</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TableTab.get_context_data">
<tt class="descname">get_context_data</tt><big>(</big><em>request</em><big>)</big><a class="headerlink" href="#horizon.tabs.TableTab.get_context_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a <tt class="docutils literal"><span class="pre">{{</span> <span class="pre">table_name</span> <span class="pre">}}_table</span></tt> item to the context for each table
in the <a class="reference internal" href="#horizon.tabs.TableTab.table_classes" title="horizon.tabs.TableTab.table_classes"><tt class="xref py py-attr docutils literal"><span class="pre">table_classes</span></tt></a> attribute.</p>
<p>If only one table class is provided, a shortcut <tt class="docutils literal"><span class="pre">table</span></tt> context
variable is also added containing the single table.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TableTab.load_table_data">
<tt class="descname">load_table_data</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TableTab.load_table_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Calls the <tt class="docutils literal"><span class="pre">get_{{</span> <span class="pre">table_name</span> <span class="pre">}}_data</span></tt> methods for each table class
and sets the data on the tables.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="tabview">
<h2>TabView<a class="headerlink" href="#tabview" title="Permalink to this headline">¶</a></h2>
<p>There is also a useful and simple generic class-based view for handling
the display of a <a class="reference internal" href="#horizon.tabs.TabGroup" title="horizon.tabs.TabGroup"><tt class="xref py py-class docutils literal"><span class="pre">TabGroup</span></tt></a> class.</p>
<dl class="class">
<dt id="horizon.tabs.TabView">
<em class="property">class </em><tt class="descclassname">horizon.tabs.</tt><tt class="descname">TabView</tt><a class="headerlink" href="#horizon.tabs.TabView" title="Permalink to this definition">¶</a></dt>
<dd><p>A generic class-based view for displaying a <a class="reference internal" href="#horizon.tabs.TabGroup" title="horizon.tabs.TabGroup"><tt class="xref py py-class docutils literal"><span class="pre">horizon.tabs.TabGroup</span></tt></a>.</p>
<p>This view handles selecting specific tabs and deals with AJAX requests
gracefully.</p>
<dl class="attribute">
<dt id="horizon.tabs.TabView.tab_group_class">
<tt class="descname">tab_group_class</tt><a class="headerlink" href="#horizon.tabs.TabView.tab_group_class" title="Permalink to this definition">¶</a></dt>
<dd><p>The only required attribute for <tt class="docutils literal"><span class="pre">TabView</span></tt>. It should be a class which
inherits from <a class="reference internal" href="#horizon.tabs.TabGroup" title="horizon.tabs.TabGroup"><tt class="xref py py-class docutils literal"><span class="pre">horizon.tabs.TabGroup</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabView.get_context_data">
<tt class="descname">get_context_data</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#horizon.tabs.TabView.get_context_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds the <tt class="docutils literal"><span class="pre">tab_group</span></tt> variable to the context data.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabView.get_tabs">
<tt class="descname">get_tabs</tt><big>(</big><em>request</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#horizon.tabs.TabView.get_tabs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the initialized tab group for this view.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabView.handle_tabbed_response">
<tt class="descname">handle_tabbed_response</tt><big>(</big><em>tab_group</em>, <em>context</em><big>)</big><a class="headerlink" href="#horizon.tabs.TabView.handle_tabbed_response" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends back an AJAX-appropriate response for the tab group if
required, otherwise renders the response as normal.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="horizon.tabs.TabbedTableView">
<em class="property">class </em><tt class="descclassname">horizon.tabs.</tt><tt class="descname">TabbedTableView</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#horizon.tabs.TabbedTableView" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="horizon.tabs.TabbedTableView.get_tables">
<tt class="descname">get_tables</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabbedTableView.get_tables" title="Permalink to this definition">¶</a></dt>
<dd><p>A no-op on this class. Tables are handled at the tab level.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabbedTableView.handle_table">
<tt class="descname">handle_table</tt><big>(</big><em>table_dict</em><big>)</big><a class="headerlink" href="#horizon.tabs.TabbedTableView.handle_table" title="Permalink to this definition">¶</a></dt>
<dd><p>For the given dict containing a <tt class="docutils literal"><span class="pre">DataTable</span></tt> and a <tt class="docutils literal"><span class="pre">TableTab</span></tt>
instance, it loads the table data for that tab and calls the
table&#8217;s <a class="reference internal" href="tables.html#horizon.tables.DataTable.maybe_handle" title="horizon.tables.DataTable.maybe_handle"><tt class="xref py py-meth docutils literal"><span class="pre">maybe_handle()</span></tt></a> method. The
return value will be the result of <tt class="docutils literal"><span class="pre">maybe_handle</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="horizon.tabs.TabbedTableView.load_tabs">
<tt class="descname">load_tabs</tt><big>(</big><big>)</big><a class="headerlink" href="#horizon.tabs.TabbedTableView.load_tabs" title="Permalink to this definition">¶</a></dt>
<dd><p>Loads the tab group, and compiles the table instances for each
table attached to any <a class="reference internal" href="#horizon.tabs.TableTab" title="horizon.tabs.TableTab"><tt class="xref py py-class docutils literal"><span class="pre">horizon.tabs.TableTab</span></tt></a> instances on
the tab group. This step is necessary before processing any
tab or table actions.</p>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference internal" href="#">Horizon Tabs and TabGroups</a><ul>
<li><a class="reference internal" href="#tab-groups">Tab Groups</a></li>
<li><a class="reference internal" href="#tabs">Tabs</a></li>
<li><a class="reference internal" href="#tabview">TabView</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="tables.html"
                                  title="previous chapter">Horizon DataTables</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="forms.html"
                                  title="next chapter">Horizon Forms</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/ref/tabs.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="forms.html" title="Horizon Forms"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="tables.html" title="Horizon DataTables"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Horizon 2012.2.3 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, OpenStack, LLC.
      Last updated on Feb 08, 2013.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>