推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
jmania
V2EX  ›  Python

flask-wtf 中如何让 selectField 读取的数据中选中默认项?

  •  
  •   jmania · Aug 15, 2013 · 10898 views
    This topic created in 4831 days ago, the information mentioned may be changed or developed.
    6 replies  •  1970-01-01 08:00:00 +08:00
    jmania
    jmania
    OP
    Aug 15, 2013
    1
    没人知道咩?
    ry_wang
    ry_wang
    Aug 15, 2013
    2
    如果是CreateForm场景,在Form定义处设置field的default值为True。
    如果是EditForm场景,设定传参field.data为True。
    jmania
    jmania
    OP
    Aug 15, 2013
    3
    是EditForm场景,能不能详细说下?网上都搜不到资料
    Perry
    Perry
    Aug 15, 2013
    4
    在render template之前使用formname.fieldname.data = 默认的选项
    jmania
    jmania
    OP
    Aug 15, 2013
    5
    @Perry 非常感谢
    lepture
    lepture
    Aug 16, 2013
    6
    提醒一下,Flask-WTF 发布 0.9.0 了。

    http://python-china.org/topic/647
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1713 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 16:19 · PVG 00:19 · LAX 08:19 · JFK 11:19
    ♥ Do have faith in what you're doing.