I have this below scenario as an example
Current scenario
{% for city in cities %}
<div id="{{city.country}}">
<p>Choose a city</p>
<li>{{ city.name }}</li>
</div>
{% endfor %}
What I want
<div id="{{city.country}}">
<p>Choose a city</p>
{% for city in cities %}
<li>{{ city.name }}</li>
{% endfor %}
</div>
How can I achieve that? Thanks
[{"countryname": [{"name": etc...