【发布时间】:2011-12-20 05:48:23
【问题描述】:
要使用 WTForms 以指定数量的列和行来呈现我的 textareafield,我如何设置列数和行数?我按照这个问题的说明进行操作,但没有奏效:
How to specify rows and columns of a <textarea > tag using wtforms
我尝试添加一个小部件,但没有成功:
class AForm(Form):
name = TextField('Name', [validators.Length(min=4)])
title = TextField('Title', [validators.Length(min=4)])
text = TextAreaField('Text', widget=TextArea(row=70, cols=11))
phonenumber = TextField('Phone number')
phonenumberhide = BooleanField('Display phone number on site')
price = TextField('Price')
password = PasswordField('Password')
email = TextField('Email', [
validators.Length(min=6, message=_('Little short for an email address?')),
validators.Email(message=_('That\'s not a valid email address.'))
])
TypeError: object.new() 没有参数
【问题讨论】:
-
{{form.text(cols="35", rows="20")|safe}}正在工作