On Sun, Feb 21, 2010 at 3:35 AM, Anand Chitipothu <[email protected]> wrote:
>> Well, apart from theoretical jQuery thing, which is not hard to deal
>> with in Templetor, except that it's a bit more typing, there's one
>> more thing that's a bit awkward. The if clause in tag attributes. For
>> example:
>>
>> $if sunny:
>>    <div class="yellow">
>> $else:
>>    <div class="grey">
>> ...
>> </div>
>>
>> would be nicer if it looked like:
>>
>>    <div class="$('yellow' if sunny else 'grey')">...</div>
>
> I use this:
>
>  <div class="$cond(sunny, 'yellow', 'grey')">...</div>
>
> after adding web.cond to template globals.

Thanks for that. Just what I wanted!


-- 
Branko Vukelić

http://foxbunny.tumblr.com/
http://www.flickr.com/photos/16889...@n04/
http://www.twitter.com/foxbunny
http://github.com/foxbunny

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to