SV: [ZPT] Yuk! Someone please improve on this...

Chris Withers chrisw@nipltd.com
Mon, 10 Sep 2001 16:10:20 +0100


"Fred L. Drake, Jr." wrote:
> 
>   This is not abuse; we write code like this all the time.  The
> resulting behavior is intentional.

Ah... I always thought it was just to get around python not having the
equivalent of x ? x : z in C.

But something like:

odd and '#EEEEEE' or '#FFFFFF'

...really isn't that readable to me :-S

Maybe I'm just a language pedant who likes boolean types which only have two
states ;-)

>   First, you ask us if you should start sleeping with your sister, and
> now you're considering that Guido might be a night-dweller?  Get some
> help!

*grinz* I thought that's what mailing lists were for? ;-)

>   Off the top of my head:
> 
>         <td tal:content="structure item/title | string:&nbsp;;" />
> 
> (Completely untested, of course!)

<!-- Page Template Diagnostics
 Compilation failed
 Products.PageTemplates.TALES.CompilerError: Invalid variable name
"string:&nbsp;;"
-->

In an ideal world, what I'd really like would be:
<td tal:content="item/title | structure string:&nbsp;;" >

...but:

1. I get:
<!-- Page Template Diagnostics
 Compilation failed
 Products.PageTemplates.TALES.CompilerError: Invalid variable name "structure
string:&nbsp;;"
-->

2. It won't work, I'll still get a blank string substituted when title exists
but is blank.

cheers,

Chris