Django: Form field size
In Django Templates, how do i specify the size of a field
This is 开发者_开发百科my form class:
class PstForm(forms.Form):
hours = forms.ChoiceField(choices=[(6,6),(24,24),(48,48)], widget=forms.Select(attrs={'size':'3'}))
however this still renders a rather long field
how do i limit the size?
You could try adjusting the CSS: attrs={'style': 'width:10px'}
, (or 'class': 'some-class'
, etc).
精彩评论