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