> Joshua J. Kugler wrote:
> The problem here is that si is a Python dictionary, but in the template
> you access the key as an attribute, not as a key. Do this instead:
>
>  > <title>${si['StationDescriptiveName'] - Current Conditions</title>
>
> Remember Kid expressions are plain Python. You can always test them with
> a print statement outside the template. If you had done that, you would
> have got the same AttributeError.

Well, that certainly explains it.  I had incorrectly implied from this:
http://www.kid-templating.org/language.html#identifier-shortcut-name that
objects would be "flattened" and anything would be available via the "dot"
operator.  Sorry for the misunderstanding.  Of course, I amused to
Template Toolkit in Perl where objects (arrays, hashes, etc) are flattened
and accessible via the dot operator.


>> Is there something I'm missing?  I never did see any examples in the
>> docs of passing dicts and arrays, so maybe it's not possible?
> Actually you can pass all possible Python objects to your Kid template.

Very cool.

> The good news is that help is on the way. Kid version 0.9.5 which should
> be available in the next days is able to track the erroneous line down
> to the original Kid template.

Sounds good. Thanks!

j


-------------------------------------------------------------------------
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