How do you embed variable in a variable in Jinja2? -


i pass in value jinja2 template called "key". "key" string "user_id" or "birthdate". "key" dictionary key. access {{key}} in jinja2. however, want access value of "key" in dictionary. "item" array of dictionaries. want {{item.{{key}}}}, isn't proper syntax. how should this?

assuming item list, should access offset in list want (e.g. if want offset of x, use item[x]) dictionary. @ point can use dictionary .get() syntax:

item[x].get(key) 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -