Hi
I am starting to work with Mako and im finding some problems. Apologies if the question is dumb
I am finding two problems. The first one, is that i can't send a list of data to mako to render it in an HTML.
I have a list of dictionaries like this:
[{'name' : 'javi', 'country' : 'Spain'}, {'name' : 'john', 'country' : 'UK'}]
And i want to create an HTML like this:
javi - Spain
john - UK
What is the best way of doing this with Mako? As far as i know, you can't send a list as a parameter to render method in Mako, isnt it?
The second one comes after i tried to created the list as a parameter in the dictionary, something like this:
{'data' :[{'name' : 'javi', 'country' : 'Spain'}, {'name' : 'john', 'country' : 'UK'}]}
My template is as follows:
But then, I have this error:
AttributeError: 'dict' object has no attribute 'name'
What is the right way to access a key inside a dictionary?
Thanks