Opened 5 years ago

Closed 5 years ago

#20957 closed New feature (duplicate)

Define form_list directly in the WizardView subclass

Reported by: Berislav Lopac Owned by: nobody
Component: Generic views Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently, the list of forms for WizardView is defined as the first parameter of the as_view method, called in the URLconf. It seems to me that it would be more Django-like if it was possible to define it in the view itself, for example as an optional attribute of the form. So it would be possible to define the view like this:

class MyWizardView(WizardView):

    form_list = [WizardForm1, WizardForm2]

    def done(self, form_list, **kwargs):
        return redirect('foo')

Stating forms in the URLconf seems to me plain wrong and non-Djangoish. Of course, it should still be possible to do it (for backward compatibility), in which case the attribute would be ignored.

Change History (1)

comment:1 Changed 5 years ago by Tim Graham

Resolution: duplicate
Status: newclosed

In fact, this was added in Django 1.6 [b614c47f].

Note: See TracTickets for help on using tickets.
Back to Top