Created
August 9, 2018 20:06
-
-
Save rwoloszyn/9fa279b77a9aa7fbc908cb56caccc900 to your computer and use it in GitHub Desktop.
Django get element from m2m relation in django template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% with object.group_set.all|first as group %} | |
<li class="breadcrumb-item"><a href="{% url 'group_detail' group_id=view.kwargs.group_id %}">{{ group.name }}</a></li> | |
{% endwith %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment