Buffet: a full spread of templates
I wrote a new filter for CherryPy late last week. Buffet supports templating with Cheetah, Kid, Myghty and simple Python String Templates. In your page handlers, you either return a tuple of (’template_name.tmpl’, {’foo’:'bar’, ’spam’:'eggs’}) or use a decorator to specify the template and simply return a dict from your page handler. Depending on if folks find it useful, I will add support for other templating engines.
I was inspired by TurboGears and its nicely integrated templating setup as well as a discussion on the TurboGears mailing list regarding integrating TG and Subway. One of the main hangups in integrating/combining the two frameworks seems to be that TG uses Kid while Subway uses Cheetah.
I know that this filter won’t move the TG/Subway integration goal forward because there are other issues than simply what template engine is used to render a view, but it just seemed like it might be a handy filter to have down the road for other needs. Plus, I had time to kill and doing stuff with CP is just “fun”
Merry Christmas and Happy New Year!
cw
January 7th, 2006 at 1:27 am
[...] the occasional occurrence i pity the fool! « Buffet: a full spread of templates [...]