I need some way to add a class attribute to the output of the label_tag() method for a forms field.
I see that there is the ability to pass in an attrs dictionary a
How about adding the CSS class to the form field in the forms.py, like:
class MyForm(forms.Form):
title = forms.CharField(widget=forms.TextInput(attrs={'class': 'foo'}))
then I just do the following in the template:
Of course this can easily be modified to work within a for loop tag in the template.