[ZPT] Select/Repeat Syntax

Philip Kilner phil at xfr.co.uk
Tue Aug 3 00:45:44 EDT 2004


Hi Andreas,

Andreas Jung wrote:
>>            tal:attributes="value repeat/Assess/ExaminationDate"
> 
>                                                    ^^^^^
> Why are you using 'repeat' at this point?? Kick it!
> 

I was going round in circles because I've been staring at it too long. 
After some more Googling, I found one of your previous posts - so you'd 
helped me even before you replied!

I now have: -

<select name="Assessdate"
         tal:define="AssessList here/rsOpenAssessments">
     <option tal:repeat="Assess AssessList"
             tal:attributes="value Assess/ExaminationDate;
                             SELECTED python: 
result.CurrentDate==Assess.ExaminationDate"
                         tal:content="python: 
Assess.ExaminationDate.strftime('%d/%m/%Y')">ExaminationDate</option>
</select>

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.

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


-- 

Regards,

PhilK

Email: phil at xfr.co.uk / Voicemail & Facsimile: 07092 070518

"The lyf so short, the craft so long to learne" - Chaucer



More information about the ZPT mailing list