3 ms·
I agree that this is pretty frustrating - it's one of the things my django-html package addresses: http://github.com/simonw/django-html http://github.com/simonw
by simonw 17y ago
I agree that this is pretty frustrating - it's one of the things my django-html package addresses: http://github.com/simonw/django-html http://github.com/simonw/django-html
{% field form.name class="myclass" %}
- zeemonkee 17y agoI had a similar workaround in a project, it did something like this: {% form.name|attrs:"class='foo', maxlength=20" %} If Django templates allowed function calls however (as Jinja2 does) that would eliminate the need for a lot of these tags.