[LWN Logo]

From: Jim Fulton <jim.fulton@digicool.com>
Subject: DocumentTemplate 2.1 available
Date: Thu, 14 May 1998 19:01:34 EDT

Document templates provide for creation of textual documents, such as
HTML pages, from template source by inserting data from python objects
and name-spaces.  Document templates are especially useful when it is
desirable to separate template text from python program source.

Release 2.1 is abailable at http://www.digicool.com/releases/bobo/.
This release has a number of new features and bug fixes.

Features

  - The rendering code has been rearranged substantially to 
    improve performance.  Most common rendering operations, like
    simple-variable and conditional insertion are "inlined" in the
    main rendering loop.  This avoids many method calls.

    An unfortunate side effect of this change is that error
    tracebacks are less informative.  This will be addressed in a
    future and probably the next release.

  - A new tag, 'with', has been added to simplify accessing
    subobjects. For example, if the variable 'emp' is an instance,
    the 'with' tag can be used to easily access attributes of 'emp'
    without using an expression.

  - A new 'raise' tag supports raising exceptions from
    DocumentTemplates.  A future release will have a try/except tag.

  - The special variable, '_', now provides namespace access in
    addition to providing access to special "builtin" functions.

  - Security-aware 'getattr' and 'hasattr' methods have been
    added to the special '_' variable.

  - New 'render' method for '_' to render expressions in much the
    same way that the 'name' tag attribute automatically renders
    retrieved objects by calling sub-templates and functions.

Bugs fixed

  - A bug has been fixed in the handling of 'KeyError' exceptions
    in rendering of conditional tags, like 'if' and 'unless'.  Now
    an 'if' tag considers an undefined variable to be "false" as
    described in the documentation.

Jim

==
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

-- 
-------- comp.lang.python.announce (moderated) --------
Article Submission Address:  python-announce@python.org
Python Language Home Page:   http://www.python.org/
-------------------------------------------------------