我使用的是单选字段,我希望将默认值呈现为(.)而不是()。我尝试了直截了当的方法:
choice_switcher = RadioField('Choice?', [validators.Required()], choices=[('choice1', 'Choice One'),('choice2', 'Choice Two')], default='choice1')
它不起作用。它提供两种选择:
( ) Choice One
( ) Choice Two
我想看看这个:
(.) Choice one
( ) Choice Two
对我来说很好:
示例.py
test_form.html
生成的html:
相关问题 更多 >
编程相关推荐