dep*_*oul 9 python google-app-engine jinja2
我已经制作了一些用于显示文本行和标签的小宏:
{% macro input(name, text, help_text, value="", input_type) -%}
<label for="id_{{name}}">{{text}}<span class="right">{{help_text}}</span></label>
<input id="id_{{name}}" name="{{name}}" value="{{value}}" type="{{input_type}}" />
{{%- endmacro %}
Run Code Online (Sandbox Code Playgroud)
问题是当我调用jinja2宏时:
{{input("username", "Korisni?ko ime:", "Pomo?", {{value_username}}, "text")}
Run Code Online (Sandbox Code Playgroud)
当我用{{value_username}}参数调用输入时,我无法使它工作,我总是得到一个错误.
你知道任何解决方案我怎么称呼{{value_username}}为参数.
Emm*_*ler 14
我相信
{{ input("username", "Korisni?ko ime:", "Pomo?", value_username, "text") }}
Run Code Online (Sandbox Code Playgroud)
应该管用
| 归档时间: |
|
| 查看次数: |
9706 次 |
| 最近记录: |