from django.forms import TextInput from django.utils.safestring import mark_safe class ThreadPickWidget(TextInput): def render(self, name, value, attrs=None, renderer=None): attrs['class'] += ' threadpick-input' html = super(ThreadPickWidget, self).render(name, value, attrs) html = html + ' ' % name return mark_safe(html)