开发者

Using Radio Button for boolean field in Modelform

in models

choice = models.BooleanField()

in forms I use

choices = (
('1', 'Buy'),
('0', 'Sell'),

)

choice = forms.TypedChoiceField(label=u'Тип предожения', choices=choices, widget=forms.RadioSelect,)

but when i edit ite开发者_C百科m, value is not selected... How can I make to previous selected value be marked


You've used strings for your choices keys. Booleans are True and False.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜