title: Passing value to Bootstrap modal in Django
body: <p>I have a nice modal showing a delete confirmation dialog each time user wants to delete data. The problem is many of my views render a list of elements in the template, and each element has its detail as well as a tiny delete red button. Of course in django the view passes a list of elements to the template, for example a list of clients, and they are rendered in a table like the following:</p>
  
  <pre><code>&lt;table class="table table-striped"&gt;  
      &lt;thead&gt;  
        &lt;tr&gt;
          &lt;th&gt;Email&lt;/th&gt;
        &lt;/tr&gt;  
      &lt;/thead&gt;  
      &lt;tbody&gt;
        {% for client in clientes %}
          &lt;tr&gt;  
            &lt;td&gt;{{ client.email }}&lt;/td&gt;
            &lt;td&gt;
              &lt;div class="btn-group"&gt;
                &lt;!-- Delete button --&gt;
                &lt;a href="#myModal" class="btn btn-danger btn-mini" title="Eliminar"&gt;
                  &lt;i class="icon-trash icon-white"&gt;&lt;/i&gt;&lt;/a&gt;
              &lt;/div&gt;
            &lt;/td&gt;
          &lt;/tr&gt; 
        {% endfor %}
      &lt;/tbody&gt;  
  </code></pre>
  
  <p> </p>
  
  <p>I would like to have a Bootstrap modal every time user presses on the delete-button to appear and confirm he is deleting some data. Now, I have managed to make the modal appear and delete the user, but not the correct user, modal somehow its only getting, or trying to delete the first user in the list. You can check my entire template with modal in the following link: <a href="http://pastie.org/5145275" rel="noreferrer">FULL HTML</a></p>
  
  <p>In the end, my problem is somehow related to passing the correct {{ client }} to the modal and not the first one on the list of clients, I'm supposing that happens because of the first declared modal on the for and then does not declare it anymore.</p>
  
  <p>For example, I got 3 clients in the table:</p>
  
  <pre><code>client1@something.com         detele-button
  client2@something.com         detele-button
  client3@something.com         detele-button
  </code></pre>
  
  <p>No matter what client delete-button I press, it always shows the modal with client1 data, and actually erases it if press confirm delete.</p>
  
  <p>Thank you.</p>
  
  <p>edit1: href was not ok.</p>