Skip to content
Advertisement

Tag: jinja2

how to iterate over one field in jinja2

I have a database that looks like this: and I want to group the rows on country and display with something like this: The above doesn’t seem to work as the first for loop results in the following error: Is it possible to extract just one column, and use that to group the rows, just by using jinja2 (i.e. no

Nested Dict to Table in Jinja2

I am scratching my head trying to correctly format a table from a nested dict in Jinja2, but having no luck. The dict is something like this: And I want the table to look like: The closest I have come is: But this doesn’t work. I am having trouble assigning the k1 variable without also having to extend the loop

Why it is possible to use a split filter in ansible?

It might look like a weird question by, I really would like to understand this. I am new to Ansible, and I am trying to understand how I could figure out that I can use a filter called split. As I understand, the Ansible filters are builtin inside Jinja2 engine. On the project website there is nothing about split filter.

Dropdown list issues

I’ve also been trying to set a default value in a dropdown box on HTML from the data I retrieved from MySQL. However, I noticed that if the user did not click on the dropdown box and clicked on one item from it. In other words, if they assumed the displayed value is the value they would like to submit

Advertisement