[Zope3-dev] DTML in Zope3 [was: Zope X3 3.0.0 alpha 1 released]
Philipp von Weitershausen
philipp at weitershausen.de
Fri May 21 13:30:25 EDT 2004
Terry Hancock wrote:
>>Note that DTML support in Z3 is *very* basic, though. There's no
>>infrastructure whatsoever for equipping classes with views written in
>>DTML. Even if there were, one would lack all the special traversing
>>machinery to access view and resource namespaces (e.g. for standard
>>template layout). We hope to fix this in X3.1 or so, when we introduce
>>DTML2. This will allow scripting for markup-less views, such as CSS,
>>JavaScript and the like.
>
> I'm not sure that the structure of the namespaces was really the thing
> I liked about DTML.
Well, DTML really only has one flat namespace. That's one its biggest
problems, which was very well adressed by TALES in ZPT.
> I mostly like the syntax of XML tags as keywords/statements.
Well, that's really not true. DTML doesn't use XML tags. DTML markup is
almost never well-formed XML. However, ZPT is, and that's what makes it
so easy to integrate with other technology, much better than DTML.
> And I like the way that DTML methods can be combined to form pagelets and
> pages.
That is still true for PageTemplates. I would even say, because of their
macro-slot architecture, they offer a lot more for small, customizable
page components.
You are listing advantages of DTML that are really advantages of ZPT.
You seem to be using DTML a lot for markup, the thing it's worst at.
DTML is great for anything but markup, such as plain text, CSS or SQL.
> I used DTMLFile objects much more than either DTMLMethod or DTML document,
A DTMLFile equivalent is not available in Zope3. That is what I meant with:
"There's no infrastructure whatsoever for equipping classes with views
written in DTML."
> I really like "ZSQL" as a means of accessing the MySQL database, I find
> it much more intuitive and easier to use than the built-in DB API in
> Python, which seems cumbersome to me still (I feel like the whole point
> of using MySQL is to write code *in SQL* not hide the SQL from the
> developer, which is what DB API seems to be trying to do). My biggest
> gripe is that I can't use that technique outside of Zope -- a separable
> DTML parser might make that more feasible.
I personally think the best thing about Zope3 is that we can finally use
all-Python technology like SQLObject. We don't have to reinvent the
wheel anymore. SQLScripts (f.k.a. ZSQLMethods) are good for quick hacks;
for serious applications, you really want to use an relational-object
mapper such as SQLObject, since Zope3 has a lot to offer when you're
dealing with *objects*.
Philipp
More information about the Zope3-dev
mailing list