[ZPT] Re: Select/Repeat Syntax

Godefroid Chapelle gotcha at bubblenet.be
Tue Aug 3 03:43:41 EDT 2004


Philip Kilner wrote:

<snip>

> 
> FWIW, I'm currently wrestling with: -
> 
> <span tal:replace="python: 
> result.CurrentDate.strftime('%d/%m/%Y')">Date</span>
> 
> ...which fails (on strftime) when CurrentDate is null - but I can't for 
> the life of me figure out how to make the evaluation dependant upon the 
> date being populated.

<span tal:define="curDate result/CurrentDate"
       tal:replace="python:test(curDate is None, 'your default string',
                    curDate.strftime('%d/%m/%Y'))">Date</span>

should do it...

> 
> (This is why I volunteer to document products but not write them - I 
> seem to be a slow learner! <grin>)
> 
> 


-- 
Godefroid Chapelle (aka __gotcha)                http://bubblenet.be



More information about the ZPT mailing list