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