How do web templates separate content and logic?
termim at gmail.com
Thu Jul 3 21:41:37 CEST 2008
On Jul 2, 11:09 am, George Sakkis <george.sak... at gmail.com> wrote:
> On Jun 30, 3:16 pm, Mike <ter... at gmail.com> wrote:
> > On Jun 30, 1:41 pm, George Sakkis <george.sak... at gmail.com> wrote:
> > > Because _typically_ a web template consists of mostly HTML, with
> > > relatively little presentational logic and (ideally) no business
> > > logic. Now, if all one wants to do is a quick and dirty way to, say,
> > > view a log file in the browser, a separate template is probably an
> > The keyword here is "(ideally)". These _typical_ cases are pretty much
> > restricted to a helloworld-like examples or to a pure men log file
> > browser ;).
> That's the opposite of what I said. For helloworld-like examples, a
> web template is an overkill. It's non-trivial applications that can
> show off what a template language buys you.
Yes, I really meant the opposite - _typically_ a web template consits
more than just HTML. Exception - helloworld-like examples.
> > Real application templates quickly became complicated and
> > require full blown scripting engine. Zope/Plone/Trac templates are
> > good examples of this.
> What does "this" refer to? Injecting business logic or just
> complicated presentational logic?
By "this" I try to support my statement that in real life applications
templates are much mor complicated than just HTML.
> I took a look and as much as I like Python for general programming, I
> find these templates more readable and maintenable than straight
> string-concatenating Python. YMMV.
Completely agree here - straight string-concatenating in Python is not
More information about the Python-list