Last active
January 2, 2018 14:45
-
-
Save simanacci/58c88d039fc62cc22a2531c3faca6409 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, request | |
from flask_wtf import FlaskForm | |
from wtforms import SubmitField, SelectMultipleField, widgets | |
class MultiCheckboxField(SelectMultipleField): | |
widget = widgets.ListWidget(prefix_label=False) | |
option_widget = widgets.CheckboxInput() | |
class ExampleForm(FlaskForm): | |
foo = MultiCheckboxField('label' | |
coerce=int, | |
choices=[(1, 'one'), (2, 'two'), (3, 'three')], | |
validators=[]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment