开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜