attribute
block
constant
cycle
date
dump
html_classes
include
max
min
parent
random
range
source
country_timezones
template_from_string
当模板使用继承时,可以使用 parent 功能:
1 2 3 4 5 6 7
{% extends "base.html" %} {% block sidebar %} <h3>Table Of Contents</h3> ... {{ parent() }} {% endblock %}
这个 parent() 调用将返回 sidebar 中定义的块 base.html 模板。
parent()
sidebar
base.html
参见
extends, block, block