{% for s in sample_stains %} {% if slide.stain.id == s.id %} {% else %} {% endif %} {% endfor %}