jazzband / django-formtools

A set of high-level abstractions for Django forms
https://django-formtools.readthedocs.io
BSD 3-Clause "New" or "Revised" License
784 stars 135 forks source link

StepsHelper is not iterable #275

Open nerdoc opened 4 weeks ago

nerdoc commented 4 weeks ago

A StepsHelper must be made iterable to create useful wizard steps graphics, e.g. in Django (any jinja2 template too):

  <ul class="steps steps-counter">
    {% for step in wizard.steps %}
      <li class="step-item{% if wizard.steps.current == step %} active{% endif %}">{{ step }}</li>
    {% endfor %}
  </ul>

You need to iter over the wizard steps to do that, but the StepsHelper class is not iterable.

I may add a simple PR to do that?

nerdoc commented 4 weeks ago

It could be a workaround (or a solution?) to use for step in wizard.steps.all?