有没有办法在 cheetah 中声明静态方法?IE
片段.tmpl
#def address($address, $title)
<div class="address">
<b>$title</h1></b>
#if $address.title
$address.title <br/>
#end if
$address.line1 <br/>
#if $address.line2
$address.line2 <br/>
#end if
$address.town, $address.state $address.zipcode
</div>
#end def
....
other snippets
其他.tmpl
#from snippets import *
$snippets.address($home_address, "home address")
此代码报告此错误:NotFound: cannot find 'address'
. Cheetah 将其编译为绑定方法,natch:
片段.py
class snippets(Template):
...
def address(self, address, title, **KWS):
有没有办法声明静态方法?如果没有,有什么替代方法可以实现这样的东西(片段库)?