V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
coolair
V2EX  ›  问与答

Flask 在 views 里面删除了 form 的某一 field,如何在 template 里过滤掉?

  •  
  •   coolair · Dec 16, 2016 · 1066 views
    This topic created in 3431 days ago, the information mentioned may be changed or developed.
    用 del 删除了 form 的一个 field ,在 template 用 if form.field 判断,但是有问题。
    如果在删除前(还没遇到删除的条件)打开了带这个 field 的 form ,在删除后,就会报错, template 找不到对应的 form field ,此时,重启下服务器,可以顺利访问,重启服务器后,这个 template 的 if 就生效了。

    这是什么问题?缓存?
    1 replies    2016-12-18 00:13:09 +08:00
    wellsc
        1
    wellsc  
       Dec 18, 2016 via Android
    看不懂
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3033 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 04:50 · PVG 12:50 · LAX 21:50 · JFK 00:50
    ♥ Do have faith in what you're doing.