Advertisement
Guest User

Untitled

a guest
May 30th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. conn = psycopg2.connect(constr)
  2. cur = conn.cursor()
  3.  
  4. sqlstr = "SELECT DISTINCT adm0_name FROM wld_bnd_adm0_gaul_2015 ORDER BY adm0_name;"
  5. cur.execute(sqlstr)
  6. countries = cur.fetchall()
  7. ctx['countries'] = countries
  8.  
  9. {% if countries %}
  10. {% for cntr in countries %}
  11. <li><a href="#" id= {{ cntr }}>{{ cntr }}</a></li>
  12. {% endfor %}
  13. {% endif %}
  14.  
  15. [(u'Abyei',), (u'Afghanistan',), (u...
  16.  
  17. countries = json.dumps(countries)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement