Lee McFadden wrote:
> On 11/18/06, Ingo Haase <[EMAIL PROTECTED]> wrote:
> >
> > or
> > tell KID to ignore None Objects?
> >
>
> This is fairly easily done.
>
> ${a and a.abc or ""}
>
> Since Python evaluates and's lazily, if a is None it will evalutate as
> false and return an empty string.

Or if you have a block that depends on having a valid object you can
also check for that:

<div py:if="a is not None">
${a.abc} ${a.xyz}
</div>

-- Matt Good


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to