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

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