这是一个创建于 2754 天前的主题,其中的信息可能已经有所发展或是发生改变。
我的定义是这样的,没有另外键另一个表,能不能在模板上取到我选择的值
user_type = SelectField(u'用户类型', validators=[Required()] ,choices=[('0', u'房客'),('1', u'房东')])
1 条回复 • 2017-03-06 23:20:32 +08:00
|
|
1
codeframe 2017-03-06 23:20:32 +08:00
在模板里直接用 form.user_type() 会自动帮你生成对应的选择列表
|