【问题标题】:Nested django template tags嵌套的 Django 模板标签
【发布时间】:2012-07-09 20:22:28
【问题描述】:

我需要实现这样的东西:

{% include "pay_forms/{{ pay_gw.name }}.html" %},其中{{ pay_gw.name }} 是标签。 我怎么能意识到这一点?

【问题讨论】:

  • 我尝试从某些上下文中包含不同的模板

标签: python django


【解决方案1】:
"pay_forms/"|add:pay_gw.name|add:".html"

(how to concat strings in Django templates)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-07
    • 2011-12-15
    • 1970-01-01
    • 2010-09-20
    • 1970-01-01
    • 2011-08-20
    • 2017-01-18
    • 1970-01-01
    相关资源
    最近更新 更多