title: Django template - set checkbox checked if object.val == true
body: <p>I'm junior backend dev. I don't know how to use JS.</p>
  
  <p>I can't set </p>
  
  <pre><code>&lt;input type="checkbox" name="player_check"&gt; 
  </code></pre>
  
  <p>true... 
  or reverse i can't set </p>
  
  <pre><code>&lt;input type="checkbox" name="player_check" checked&gt;
  </code></pre>
  
  <p>false.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;table id="some_table"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Prepared&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      {% for player in players %}
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="checkbox" name="player_check"&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      {% endfor %}
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Let's say in 'players' I have 5 players, each player has a value "player_check".</p>
  
  <p>Two of them have:</p>
  
  <pre><code>player.player_check = True
  </code></pre>
  
  <p>Rest:</p>
  
  <pre><code>player.player_check = False
  </code></pre>
  
  <p>I'm trying to initiate checkbox in my table with these values using {{}} or {% %}</p>
  
  <p>I've tried:</p>
  
  <pre><code>&lt;input type="checkbox" name="player_check" value=1&gt;
  &lt;input type="checkbox" name="player_check" value="1"&gt;
  &lt;input type="checkbox" name="player_check" value="True"&gt;
  &lt;input type="checkbox" name="player_check" value=True&gt;
  &lt;input type="checkbox" name="player_check" value="checked"&gt;
  </code></pre>
  
  <p>Nothing works...
  Then i found that checkbox has a parametr checked so:</p>
  
  <pre><code>&lt;input type="checkbox" name="player_check" checked&gt; 
  </code></pre>
  
  <p>That was ok BUT... now i cant turn it off:</p>
  
  <pre><code>&lt;input type="checkbox" name="player_check" checked="false"&gt;
  &lt;input type="checkbox" name="player_check" checked="0"&gt;
  &lt;input type="checkbox" name="player_check" checked=0&gt;
  &lt;input type="checkbox" name="player_check" checked="unchecked"&gt;
  </code></pre>
  
  <p>So i decided to use django templpates + change in python code:
  Now <strong>player.player_check equals checked or unchecked</strong></p>
  
  <p></p>
  
  <p>It still doesn't work! Now i can't put {{ }} without name like "something"={{ foo }}</p>
  
  <p>Now i have 0 ideas what i can do more to make it work... Maybe JS? but i cant believe there is no right way to do it just in django/python. ;/</p>