LoginSignup
3
2

More than 5 years have passed since last update.

Flaskで<input type="date">を使う

Last updated at Posted at 2015-12-25

Flaskでフォームを使うために,wtformsを使うが,HTML5から追加された <input type="date">が使えなかったので,調べてみた.

これではダメで,

model.py
from wtforms import DateField

date = DateField()

こうするとよい.

model.py
from wtforms.fields.html5 import DateField

参考:http://stackoverflow.com/questions/19588393/datefield-is-not-rendered-as-type-date

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2