[Zope-dev] DTML sqltest tag and python expr. Bug in Zope Book?
Yves-Eric Martin
yemartin@yve.net
Sun, 01 Jul 2001 16:13:15 +0900
On Sat, 30 Jun 2001 11:41:57 +0200 (CEST)
Dieter Maurer <dieter@handshake.de> wrote:
> If I were a purist, I would answer: no.
>
> The name error could come from a nested call that incidentally
> uses the same name for a variable as a request argument.
Granted.
But I have just been thinking: the dtml-var tag does support python
expressions. And its "missing" attribute is quite similar to the
"optional" of dtml-sqltest, don't you think? The "missing" attribute
works only when a variable name is provided. It has no effect on python
expression: if noVar is not defined:
<dtml-var noVar missing=""> returns nothing,
<dtml-var "noVar" missing=""> raises a NameError.
So for consistency, we can do the same with the dtml-sqltest tag: it
would accept python expression, and the "optional" would work only with
variable names, not python expressions.
> If I were a Zope maintainer, I would answer: no.
>
> The feature is rarely used and if it is, there is
> a way to do it with existing DTML means:
Well, of course it is not being used much, since it is not
implemented... ;o)
Anyway, I guess it all depends on what you use Zope for. As far as I
am concerned, many of the Zope projects I have been involved in included
heavy database queries. So I used that "feature" (with the workarounds
we described) quite a lot.
> But your point was: The feature is used in the Zope book,
> thus, apparently, it was useful. The question:
> "why not implement the feature rather than change the book".
Exactly. I think that this feature should be implemented for:
o consistency with other tags,
o consistency with the Zope Book (DTML *REFERENCE*!)
o and its usefulness to people like me ;)
> Maybe, DC says something about this....
Cheers!
--
Yves-Eric Martin
yemartin@yve.net