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

Tim Churches tchur at optushome.com.au
Sat Jun 22 17:22:18 EDT 2002


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.

Albatross by Object Craft (see http://www.object-craft.com.au ) does
an excellent job of separating the presentation layer from the
underlying
logic - my understanding is that such separation was one of its main
design goals. However, it does not take a pedantic position on this - it
still allows Python code to be embedded in HTML templates - such
practice
is discouraged, but Albatross provides mechanisms to allow you to do it
if you insist. But more usefully, Albatross provides tags which allow
conditional processing (if-elif-else) and most usefully, iteration, to
be
placed in the HTML template. So your Python business logic code can
assemble
a Python sequence of, say, database query results, but it is the HTML
template
which iterates through that list to create the final HTML which is sent
to the
user's browser. Such a feature is essential, because otherwise the
business logic
Python code ends up needing to creating HTML output itself, which is
then merely
substituted into the HTMl template. Thus, the Albatross model is really
more like:
"all HTML-related stuff, including conditional processing and iteration,
is looked
after in the HTML templates, and all business logic stuff, divorced from
the manner
in which it will be presented, is handled by Python modules." Of course,
this is
just the well-known model-view-controller approach, but Albatross
implements this
very nicely, IMO. 
See
http://www.object-craft.com.au/projects/albatross/albatross/fig-presimpexec.html
for more information about this (and to get an idea of the depth of the
Albatross 
documentation).

I suspect that the Object Craft guys would welcome help with further
development of
Albatross. What the world really needs are more Pythonic Web
applications, rather 
than more Pythonic Web application frameworks.

Tim C





More information about the Python-list mailing list