Skip to content

Instantly share code, notes, and snippets.

@pcn
Created December 22, 2015 22:09
Show Gist options
  • Select an option

  • Save pcn/313ee4773a09a12fa529 to your computer and use it in GitHub Desktop.

Select an option

Save pcn/313ee4773a09a12fa529 to your computer and use it in GitHub Desktop.
Filter a dict based on value w/ jinja (untested)

Something like this:

#map={s1:leader,s2:peon,s3:peon}
{% for k, v in map.items() %}
{% if v == 'leader' %}
{{ k }}
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment