title: Jinja2: local/global variable
body: <pre><code>{% set disabled = '' %}
  {% for voter in record.voters %}
      {% if user == voter %}
          {% set disabled = 'disabled' %}
      {% endif %}
      {{ disabled }}  # outputs: 'disabled'
  {% endfor %}
  {{ disabled }}  # outputs: ''
  </code></pre>
  
  <p>I have that template in Jinja2.
  What I need is 'disabled' variable to be visible outside 'for' loop.
  Is that possible?</p>