Use value_of(var, None) :)
http://kid-templating.org/language.html#defined-name-and-value-of-name-default-functions

On 2/24/07, Jorge Vargas <[EMAIL PROTECTED]> wrote:
> Hi this question came up twice on #turbogears today and I'm wondering
> if I have the correct answer.
>
> Someone had a master.kid template that had some variables and then
> several extending it but he didn't wanted to pass the variable in all
> the calls, just the ones where it matter. But of course not passing in
> the variable will make kid give a NameError because the variable
> doesn't exist.
>
> TG has a variable_provider and a root_variable_provider, which are the
> ones in charge of populating the tg namespace inside kid, so I
> suggested that they set the variable to None and make a py:if inside
> the code, this way the variable is "optional"
>
> now I'm wondering is there a way to set kid to thread missing
> variables as None? or a better implementation then this? how will you
> do it in plain kid?
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> kid-template-discuss mailing list
> kid-template-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kid-template-discuss
>


-- 
cheers
    elvelind grandin

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to