[albatross-users] al-if question
Andrew McNamara
andrewm at object-craft.com.au
Fri Jul 29 16:21:08 EST 2005
>> <al-value expr="locals().get('blah','Blah does not exist!')"/>
>>
>> <al-if expr="locals().get('blah',False)"/>
>> Blah Exists
>> <al-else>
>> Blah Doesn't Exist
>> </al-if>
>
>This also works:
>
><al-if expr="__ctx__.has_value('blah')">
It's probably a personal style thing, but I prefer to encapsulate
something like that in an object, or initialise it to None on page entry.
The proposed solutions look a bit non-obvious to me, which will hinder
other people's understanding of your code.
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
More information about the Albatross-users
mailing list