[ZPT] Confused about Zope
Shane Hathaway
shane@zope.com
Fri, 28 Feb 2003 22:27:02 -0500
On 02/27/2003 10:31 AM, Chris Withers wrote:
> Jean Jordaan wrote:
>
>>> Not overly pretty, but certainly no less pretty than DTML...
>>>
>>> <dtml-sqlvar x type="string">
>>>
>>> <tal:x replace="sql.string:x"/>
>
>
> Sorry, that should have read:
> <tal:x replace="options/sql.string:x"/>
>
> ...so you know for definite where x is coming from.
FWIW, I think I'd want to write it like this:
<tal:x replace="options/x/sql:string" />
The idea is that after you've retrieved the value of "x" from the
options, you invoke the "string" method of the SQL formatting API to
make the database understand that the value is a string. (To those who
don't follow zope3-dev: Chris and I are talking about a possible new
syntax in TALES expressions that we've been discussing this week.)
Here's an idea, though. In contexts like ZSQL methods, we specifically
don't care about XML format, so the "tal:x" is what Jim calls a "dead
chicken", or in other words, a meaningless sacrifice. :-) At the same
time, we don't want to stray far from TAL, so that no one has to learn
something new. So what if, in non-XML TAL, we chopped off the tag name?
We could write the above expression in a slightly more logical way:
<tal:replace="options/x/sql:string"/>
I'm tempted to also say that all tags should automatically use the TAL
namespace, so then we could make it a little shorter and cleaner:
<replace="options/x/sql:string"/>
Opinions?
Shane