<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 9, 2014 at 2:11 AM, Tobias Florek <span dir="ltr"><<a href="mailto:haskell@ibotty.net" target="_blank">haskell@ibotty.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">hi,<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The objects generated by the templates don't do much of<br>
anything to let the application author leverage the type system, which<br>
is what makes Cheetah stand out from other web template systems.<br>
</blockquote>
<br>
can you elaborate on that point? i would really like to see an example on what you mean.<br>
<br>
for another datapoint, have a look at hastache's use of generics<br>
 <a href="http://hackage.haskell.org/package/hastache/docs/Text-Hastache.html" target="_blank">hackage.haskell.org/package/<u></u>hastache/docs/Text-Hastache.<u></u>html</a></blockquote><div><br></div><div>I mentioned that briefly in the original message: A Cheetah template is a Python class. It can inherit from Python classes, and Python classes can inherit from it.</div>
<div><br></div><div>A standard usage is to have a page template that sets up headers and footers, and make your pages are all children of that class. While header/footer support is a stock feature of any modern templating system, Cheetah does it by leveraging it's integration into the Python class system instead of providing a specific mechanism for it.</div>
<div><br></div><div>If you need something to happen on the server when the page renders - that doesn't leave any traces in the output - you can subclass the template with a standard Python class and provide that functionality. You then use the Python subclass just like a regular template.  Again, the behavior isn't special, but doing it takes no special machinery, just leveraging Cheetah templates being classes.</div>
<div><br></div><div>You can find simple examples of this in the Cheetah docs:</div><div><a href="http://www.cheetahtemplate.org/docs/users_guide_html_multipage/howWorks.objoriented.html">http://www.cheetahtemplate.org/docs/users_guide_html_multipage/howWorks.objoriented.html</a><br>
</div></div></div></div>