[Zope-dev] Re: [Zope] DTML Syntax contd. + rant

Michel Pelletier michel@digicool.com
Thu, 11 Nov 1999 11:53:04 -0500


Evan Gibson wrote:
>
> Also, one thing that annoys me...
> With sql_methods I have to go:
> 
> sql.get_skin(username='default')[0].skin
> 
> even when the only thing the sql statement is returning is a single value
> and it's value _is_ ".skin".

Actually, I think DTML can express this quite well.  If you know there's
only one result (as you do here, because you're hardcoding the [0]) You
can get clean DTML with an #in block:

<dtml-in "sql.get_skin(username='default')">
  <dtml-var skin>
</dtml-in>

Little extra typing, but it looks clean to me. ;)

-Michel