17👍
✅
person.membership_set.all()
will give you a list of all Membership
instances for a given person
. You can use this in regular code as well as in the template.
for each in person.membership_set.all():
print each.date_joined
{% for each in person.membership_set.all %}
{{ each.date_joined }}
{% endfor %}
Source:stackexchange.com