I'm trying to display all events belonging to each organizer. If there is duplicate content for the oragnizer's name, it will only display the events belonging to the organizer with the highest id.
Organizer table
|id |name |
--------------------
|1 |organizer 1 |
|2 |organizer 1 |
|id |name |organizer_id |
-------------------------------
|1 |event 1 |1 |
|2 |event 2 |2 |
{% for organizer in organizers %}
{% for event in organizer %}
{{ event.name }}
{% endfor %}
{% endfor %}
event2
event1
event2
I’ve solved the problem by adding a constraint of unicity on organiser name. So the Organizer table, can’t have the same organizer name twice