Questions tagged [cheetah]

Cheetah is an Open Source Python based Templating Framework.

Cheetah is an open source template engine and code generation tool, written in Python. It can be used standalone or combined with other tools and frameworks. Web development is its principle use, but Cheetah is very flexible and is also being used to generate C++ game code, Java, sql, form emails and even Python code.

from CheetahTemplate.org

It works with Python 2.7 and 3.4+. Wheels are available at PyPI. Issues and pull requests are accepted at GitHub.

69 questions
0
votes
1 answer

Un/bound methods in Cheetah

Is there a way to declare static methods in cheetah? IE snippets.tmpl #def address($address, $title)
$title #if $address.title $address.title
#end if $address.line1
#if $address.line2 $address.line2…
colinmarc
  • 2,341
  • 1
  • 21
  • 33
0
votes
1 answer

Cheetah pre-compiled template usage

For performance reason as suggested here, I am studying how to used the pr-compiled template. I edit hello.tmpl in template directory as #attr title = "This is my Template" \${title}
leo
  • 527
  • 5
  • 11
0
votes
1 answer

Custom templates in python

I am trying to implement custom template formatting in python accomplishing two things Django like delimiter {{ placeholder }} eg. from string import Template class MyTemplate(Template): delimiter="{{..}}" #it is only for clarification…
userx
  • 546
  • 6
  • 19
0
votes
1 answer

Difference between automatic programming and compiling

CheetahTemplate allows source code generation, how is this different from a compiler generated through something like ANTLR?
Mike Vella
  • 8,913
  • 10
  • 53
  • 81
0
votes
1 answer

karrigell import my own module

i'm new in karrigell, but i got problem when i was trying to use the phase from testmodule import TestClass where the "testmodule" is my own module and TestClass is the only class defined inside the module. but when i was going to the site, i…
fly
  • 11
  • 2
0
votes
1 answer

Upgrading Cheetah Templates and Getting Odd Errors in Variable Assignment

I am attempting to upgrade Cheetah in a work project from 0.9 to 2.4.4. I'm getting some odd errors when creating certain variables inside templates. Below is an example: #set formUtil = $iLib.aquariumFactory("widget.FormUtil", …
Botono
  • 65
  • 1
  • 5
0
votes
1 answer

Cheetah #include not working

#include doesn't seem to be working, I get a "500 Internal Server Error". I tried the same code without the include, putting all the code in one file, and it works. i'm using the web framwork Flask header.tmpl …
Lex
  • 376
  • 4
  • 17
0
votes
1 answer

Iterating over python list only gives each letter

I have a list.. availablethemes = ['cerulean', 'default', 'journal', 'united'] And I'm trying to put each item in a dropdown item list