I tried to create external script, but this does not help. The result is practically the same. Anyway, I do not insist on creating objects. I just would like to have a way to return a structured result from a Python script, where I can access the named attributes easily. I have seen an example in a how-to, how to do it with dictionaries and DTML (specifying a "mapping" parameter for dtml-in), but it does not work for page templates (or at least the simple item/attribute notation does not work, and the mapping parameter does not exist in TALES path expressions). Gabor Max M wrote:
Gabor Nagypal wrote:
I would like to return a structured result (an "object") from a Python script to use it conveniently in a page template. E.g. I would like to have a get_person Python script which gives back a person with a name and an address. Then I could use a page template like:
I don't think you can create objects in a Python script. You need to create an external script for that.
Otherwise your code looks dandy.
regards Max M