[Answered ]-How to Loop through enum in Django?

1👍

Pass choices to the template, unpack and display them:

views.py

context["genders"] = Order.Gender.choices

template.html

{% for key, gender in genders %}
    <p>{{ gender }}</p>
{% endfor %}
👤Marco

Leave a comment