Web templating/db tool with best designer/coder separation?

Ian Bicking ianb at colorstudy.com
Sat Jun 22 21:14:09 EDT 2002


On Sat, 2002-06-22 at 13:43, Bengt Richter wrote:
> E.g., if you were hoping for an improvement over current practice,
> which do you consider to be the tool(s) to beat, and what would
> the killer improvement(s) be? TIA.

I think Cheetah's methods (#def) are important to real separation of
design (like MVC) -- which isn't quite the same thing as separation of
skills (like designer/coder).  Your template is an object (where you
have control of inheritance), and you can define methods for that object
inside your template.

A template should be more expressive than a primitive programming
language -- it should be able to describe how you do something more than
just how to write a page.  For instance, how to write a header, or how
to write a list.  The whole inheritance thing is pretty nice, too --
inheritance maps really well to sets of templates.


Like other templating systems that compile to Python code, it would do
well to give better error messages.  The alternative of interpretation
gives good error messages, but doesn't give good performance.  


The NameMapper in Cheetah is also spiffy (in terms of simple syntax, and
easy Python integration), but it's picky and a bit fuzzy in terms of
semantics.  Something better defined would be nice.  

NameMapper is a way of changing an expression like $a.b.c.d.e into
a.b().c['d'].e (at runtime, of course, because it depends on the types
of the objects).  It's great for adding objects and dictionaries to the
template's namespace, without burdening the non-programmer with notions
of type.

  Ian







More information about the Python-list mailing list