views:

38

answers:

2

In trying to add a cached section to a Mako template, I get the error listed in the above question. Adding () to the end gets rid of the error, but I see no content on my page. Any help is appreciated!

<%def name="test" cached="True" cache_timeout="60" cache_type="file">
    Test
/%def>
A: 
sateesh
I did of course look at the Mako documentation. This example is almost directly from there.http://www.makotemplates.org/docs/caching.htmlI get the impression you're just guessing.
Michael Mior
I've used Mako, but not in the context of generating web pages and hence wasn't aware of the caching and the modalities involved with it. I had just answered thinking that you are missing the parentheses (which are used in def definitions) and putting them would fix the issue. But I was wrong :(
sateesh
A: 

My problem was that I was not aware that <%def> defines a function. If I use the parenthesis and call the function via ${test()} right after definition, it works as expected.

Michael Mior