【发布时间】:2018-06-21 08:22:21
【问题描述】:
对于Cheetah3,有一个非常粗略的继承特性文档:http://cheetahtemplate.org/users_guide/inheritanceEtc.html#extends
但我不知道如何使它真正起作用。
假设我有两个模板文件:
A.tmpl
#def message
Hello Cheetah
#end def
This is an example: $message
B.tmpl
#extends A
#def message
Hello Cheetah with Inheritance
#end def
还有一个简单的驱动程序,例如:
from Cheetah.Template import Template
t = Template(file='B.tmpl')
print t
显然,那是行不通的,因为执行这段代码时没有A类。
但是进展如何?还是只能使用预编译的 Cheetah 模板进行继承?
【问题讨论】:
标签: python templates inheritance cheetah