jazzband / django-formtools

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

get_form_list is bypassed #168

Closed nahuelange closed 2 years ago

nahuelange commented 4 years ago

Hi,

I'm trying to implement conditionnal steps in my WizardView, using get_form_list to return the needed list of steps. When I do this, formtools raises an exception trying to access a step in the form_list class attribute. Line 409 of file formtools/wizard/views.py:

form_class = self.form_list[step] …

Don't the get_form_list method should be called everytime formtools needs the form_list instead of accessing the property?

nahuelange commented 4 years ago

In my case i must use condition_dict, but the problem about get_form_list still is a question.

spapas commented 3 years ago

Please could somebody give some love to this issue? You just need to change the the line form_class = self.form_list[step] of the get_form method to form_class = self.get_form_list()[step] to fix it.

It would be really useful to be able to fully configure the list of forms of my wizard. Using the condition_dict is not as powerful as being able to completely redefine the list of the forms.

martey commented 3 years ago

This looks like a duplicate of #62, which hasn't been merged because it doesn't include automated tests.

violuke commented 2 years ago

This change has caused a lot of people a problem, see #220, can this be reverted?