12345678910111213141516171819202122232425262728293031323334 |
- from flask_wtf import Form
- from wtforms import SelectField, StringField
- from wtforms.validators import DataRequired
- from flask_babel import lazy_gettext as _
- class SortForm(Form):
- display = SelectField(
- _('Choice'),
- coerce=int,
- choices=[(0, 'all topic'), (1, 'one day'), (2, 'one week'), (
- 3, 'one month')])
- sort = SelectField('Sort',
- coerce=int,
- choices=[(0, 'publish'), (1, 'author')])
- st = SelectField('Up and Down',
- coerce=int,
- choices=[(0, 'down'), (1, 'up')])
- class SearchForm(Form):
- search = StringField(_('search'), validators=[DataRequired()])
|