forms.py 961 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env python
  2. # -*- coding=UTF-8 -*-
  3. # **************************************************************************
  4. # Copyright © 2016 jianglin
  5. # File Name: forms.py
  6. # Author: jianglin
  7. # Email: xiyang0807@gmail.com
  8. # Created: 2016-06-03 19:27:58 (CST)
  9. # Last Update:星期五 2016-6-3 19:31:13 (CST)
  10. # By:
  11. # Description:
  12. # **************************************************************************
  13. from flask_wtf import Form
  14. from wtforms import SelectField
  15. from flask_babel import lazy_gettext as _
  16. class SortForm(Form):
  17. display = SelectField(
  18. _('Choice'),
  19. coerce=int,
  20. choices=[(0, 'all topic'), (1, 'one day'), (2, 'one week'), (
  21. 3, 'one month')])
  22. sort = SelectField('Sort',
  23. coerce=int,
  24. choices=[(0, 'publish'), (1, 'author')])
  25. st = SelectField('Up and Down',
  26. coerce=int,
  27. choices=[(0, 'down'), (1, 'up')])