gpt4 book ai didi

python - Django 。通过 include 标签将数组传递给子模板

转载 作者:行者123 更新时间:2023-11-28 22:27:44 25 4
gpt4 key购买 nike

我正在尝试动态创建一个数组并将其传递给子模板:

{% include "template.html"with foo = ['one', 'two'] %}

但这行不通。有人知道如何在父模板中生成一个数组,然后将其传递给另一个模板吗?

最佳答案

喜欢

{% include "template.html" with foo = 'one,two' %}

并使用拆分

关于python - Django 。通过 include 标签将数组传递给子模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43938894/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com