I have a form like this:
class DiaryEventForm(forms.Form):
title = forms.CharField(max_length = 200)
What generates this HTML:
<input id="id_title" type="text" name="title" maxlength="200" />
This displays as very narrow in the admin (where I have a custom view using this form).
If I have a model defined as follows:
class DiaryEvent(BaseModel):
title = models.CharField(max_length = 200)
I get this HTML:
<input id="id_title" type="text" class="vTextField" name="title" maxlength="200" />
What is the most elegant way to add a class vTextFieldto my form? This class seems to be a way of typing text, so I would like to use it, not the style itself.
source
share