【发布时间】:2011-08-18 22:14:58
【问题描述】:
是否可以将参数传递给 django 模板标签内的函数?
定义的类和函数:
class Bar():
def foo(self, value):
# do something here
return True
在模板中:
{% if my_bar.foo:my_value %}Yes{% endif %}
目前我收到 TemplateSyntaxError "Could not parse the rest"
【问题讨论】: