WTForms 不验证 MAC 地址

WTForms doesn't validate MAC address

我正在使用 WTForms 的 MacAddress 验证器,但它无法识别我输入的有效 MAC 地址。为什么它不起作用?

{'choice': [u'Invalid Mac address.']}
class EditForm(Form):
    choice = TextField('choice', validators=[DataRequired(), MacAddress()])

@app.route('/', methods=['GET', 'POST'])
def devicechoice():
    form = EditForm()

    if form.validate_on_submit():
        print form.choice.data
        return redirect(url_for('editdevice'))
    else: 
        print form.errors

    return render_template('devicechoice.html', form=form)
<form action="" method="post">
    {{ form.hidden_tag() }}
    {{ form.choice() }}
    <input type="submit">
</form>

问题已由@Ketouem 回答,只需在 Mac 地址的每 2 个字符后添加一个“:”即可验证表单。 (12:34:56:78:AB:CD)