title: Django and tabbed navigationin templates
body: <p>I am building a django project which among others has a customer model. Any customer can be a foreign key to some calendar entry models or some picture models.  I want to be able to get in to a customers page (e.g domain/customoer/1) and be able to navigate to the different models the customer is related with (e.g all the pictures for the customer, all the calendar entries of the customer). I am using bootstrap for the "presentation of the site. My idea was to use tabs. So I created a pil for my main template the customer.html</p>
  
  <pre><code>&lt;ul class="nav nav-pills"&gt;
      &lt;li class="active"&gt;&lt;a href="#personal-data" data-toggle="pill"&gt;Personal Data&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#history" data-toggle="pill"&gt;History&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#analysis" data-toggle="pill"&gt;Analysis&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#diagnosis" data-toggle="pill"&gt;Diagnosis&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#treatment" data-toggle="pill"&gt;Treatment&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#appointments" data-toggle="pill"&gt;Appointments&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#graphics" data-toggle="pill"&gt;Graphics&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>and i was thinking of including a template for each pill</p>
  
  <pre><code>&lt;div class="tab-content"&gt;
      &lt;div id="personal-data" class="tab-pane active "&gt;
      &lt;div id="history" class="tab-pane"&gt;History is in the making&lt;/div&gt;
      &lt;div id="analysis" class="tab-pane"&gt;
          {% include 'customer/analysis.html' with customer=customer %}
      &lt;/div&gt;
      &lt;div id="diagnosis" class="tab-pane"&gt;Diagnosis is differential&lt;/div&gt;
      &lt;div id="treatment" class="tab-pane"&gt;Treatment what treatment??&lt;/div&gt;
      &lt;div id="appointments" class="tab-pane"&gt;Ap point ment&lt;/div&gt;
      &lt;div id="graphics" class="tab-pane"&gt;Now this is going to be hard!&lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>The templates in each tab can do different things like upload pics navigate to different pages etc. </p>
  
  <p>When i hit on a pill the url (domain/customer/1/) won't change (naturally) to inform me to which tab i am at the moment. So my question is how can i know in which tab i am ath the moment? I want the user to be able to do different things from different tabs (upload pics etc) and I want to be able to redirect to the specific tab after the view is called? Maybe #id could be appended to the url to specify the tab, but it doesn't happen with bootstrap.</p>
  
  <p>What is the best way to deal with tabs in django? Ajax maybe? Will I not have the same problem? Any ideas or lings would be nice too</p>