{% for name, value in widget.attrs.items %}
    {% if name != 'id' %}
        {% if value is not False %} 
            {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}
        {% endif %}
    {% endif %}
{% endfor %}
