[Zope] ZPT and Python/Zope specific methods

Evan Simpson evan@digicool.com
Sun, 22 Apr 2001 13:30:53 -0400


From: "Darin Lee" <dlee@usol.com>
> I have been working with TAL, TALES, and METAL over the last few days -
and
> I thought I was kind of "getting it." However, I've hit a small snag. Is
> there a way via TAL to get to many of the Zope methods I use all the time
in
> DTML?  like ZopeTime() or bobobase_modification_time?

This is one of the areas of TALES that is still developing.  Right now,
Python TALES expressions have the same collection of builtin functions
available to them as Python-based Scripts, which is to say most of the
functions that you access from DTML as attributes of "_".  This needs a lot
of documenting.

The names you are accustomed to using in DTML can be roughly divided into
three groups:

1. Namespace attributes, such as _.int, which are usable directly in ZPT.
2. DTML Tag variables, such as sequence-item.  These don't exist in ZPT.
3. Object attributes/methods.  Most of these, such as
bobobase_modification_time, are specific to the object on which you invoke
them.  You'll get a different modification time for 'here', 'template', and
'root' (assuming that 'here' isn't the root).  A few, such as ZopeTime, are
generic functions.

> <p tal:content="here/ZopeTime">Replace this text</p>

Use "python:DateTime()" for this.

> Congrats to the ZPT team for this breakthrough techology!

Thank you!

Cheers,

Evan @ digicool