forms.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #*************************************************************************
  2. # Copyright © 2015 JiangLin. All rights reserved.
  3. # File Name: askform.py
  4. # Author:JiangLin
  5. # Mail:xiyang0807@gmail.com
  6. # Created Time: 2015-11-27 17:54:07
  7. #*************************************************************************
  8. #!/usr/bin/env python
  9. # -*- coding=UTF-8 -*-
  10. from flask_wtf import Form
  11. from wtforms import SelectField
  12. # class SortForm(Form):
  13. # display = SelectField('筛选',
  14. # choices=[('全部主题', '全部主题'), ('1天', '1天'),
  15. # ('1周','1周'),('1个月','1个月')],
  16. # validators=[DataRequired(message='分类不能为空')])
  17. # sort = SelectField('排序',choices=[('发表时间', '发表时间'),
  18. # ('作者','作者')],
  19. # validators=[DataRequired(message='分类不能为空')])
  20. # st = SelectField('升降序',choices=[('降序', '降序'), ('升序', '升序')],
  21. # validators=[DataRequired(message='分类不能为空')])
  22. class SortForm(Form):
  23. display = SelectField('筛选',
  24. coerce=int,
  25. choices=[(0, '全部主题'),
  26. (1, '1天'),
  27. (2, '1周'),
  28. (3, '1个月')])
  29. sort = SelectField('排序',
  30. coerce=int,
  31. choices=[(0, '发表时间'),
  32. (1, '作者')])
  33. st = SelectField('升降序',
  34. coerce=int,
  35. choices=[(0, '降序'),
  36. (1, '升序')])