On 10/28/06, Michael Steinfeld <[EMAIL PROTECTED]> wrote:
> so if I was to do something like
>
> import calendar, itertools
>
> month = calendar.monthcalendar(2006, 10)
> days =  [i for i in itertools.chain(*month)]
>
> if days ==0:
>     print '<td class='in'></td>
> else:
>     print '<td class='out'> days </td>
>
> what would be the 'correct' and 'most efficient' way to do that using kid?

That code has a number of errors, but assuming you're passing in the
variable days and guessing what you're shooting for, I'd do:

<div py:strip="True" py:for="day in days">
<td class="${day and 'out' or 'in'}">${day or ''}</td>
</div>

If you're not passing in days, get yourself to days in a <?python ?> block.

> And is there any benefit using a widget?

Not really.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to