Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- conn = psycopg2.connect(constr)
- cur = conn.cursor()
- sqlstr = "SELECT DISTINCT adm0_name FROM wld_bnd_adm0_gaul_2015 ORDER BY adm0_name;"
- cur.execute(sqlstr)
- countries = cur.fetchall()
- ctx['countries'] = countries
- {% if countries %}
- {% for cntr in countries %}
- <li><a href="#" id= {{ cntr }}>{{ cntr }}</a></li>
- {% endfor %}
- {% endif %}
- [(u'Abyei',), (u'Afghanistan',), (u...
- countries = json.dumps(countries)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement