The dict_get() and dict_set() looks like the best way to go about this. And yes they would be useful.
However, this brings up something I've thinking about for a while now; would it possible to add another mode called python mode to the template language. I don't know how easy to implement this would be. The idea is that it passes mi object were we can process it directly. It would be more handy than defining a template function in python — for every use once scenario — and calling it from other modes. Of-course, if the implementation involves more than just a simple pass-through, it would not be worth the effort.
There are other template things that are only tangentially related to your proposal, so I will raise them in the template thread instead.
|