Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% if performer.teaches_for.exists %}
- <h3>{{performer.first_name}} teaches at these schools...</h3>
- <ul>
- {% for school in performer.teaches_for.all %}
- <li><a href="/schools/{{school.id}}">{{ school.name }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- teaches_for = models.ManyToManyField(
- School,
- verbose_name="Teaches at this school",
- blank=True,
- related_name="teachers",
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement