Tol*_*lga 5 django django-templates
我想学习如何使用嵌套模板标签,其中子模板标签采用如下参数:
{% parent_tag {% child_tag arguments %} rest_of_parent_arguments %}
Run Code Online (Sandbox Code Playgroud)
在上面的行中,我想使用child标签的返回值作为父标记的参数.
我会用自定义过滤器替换child_tag.就像是:
{% parent_tag argument1|filtername:argument2 rest_of_parent_arguments %}
Run Code Online (Sandbox Code Playgroud)
假设"参数"最多包含2个参数.在此处查看自定义过滤器:
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters
| 归档时间: |
|
| 查看次数: |
2811 次 |
| 最近记录: |