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