ZPT and Python/Zope specific methods
Zopatistas, 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? I have read the 1.0 specifications, but I'm not clear how those methods are mapped to the "path based" way of accessing objects and methods in ZPT. Is there an object (i.e. "root") that let's me access these methods? This all started when I decided to add a last modified field in the footer of my pages with TAL: <p tal:content="here/ZopeTime">Replace this text</p> Some methods work, while others do not. Is there any documentation I can reference which describes specifically what I can call from TAL/TALES/METAL? Overall, I would say ZPT is a *great* thing. If all goes well, this will lift Zope out of the WYSIWYG client integration issues that plague *all* of the other closed source CMS solutions. Zope is, imho, superior to the CMS's I have researched in it's clean object->URL translation alone (you should see some of the unintelligable URL's Vignette produces). Furthermore, I'm not sure how many out there have tried to write Web Applications in TCL or ASP, but Python is a breath of fresh air when it comes to coding. If ZPT delivers on it's presentation layer promise (which I believe it will), then world domination is surely not far behind. ;-) Congrats to the ZPT team for this breakthrough techology! Thanks, Darin Lee
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
participants (2)
-
Darin Lee -
Evan Simpson