﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16236	Formwizard: computing form initialization keyword arguments	Anton Strogonoff	nobody	"Currently, it isn't possible to provide custom form initialization arguments without overriding the entire get_form() method of wizard view, which is some unnecessary code duplication. So it may be better for !WizardView to compute form's kwargs in a separate method, like generic !FormView does.

For example, with the patch applied, to initialize form at a step called 'delivery-method' with a city that you have since the 'start' step, you would add these lines to your wizard class definition:

{{{
#!python
def get_form_kwargs(self, step, data=None, files=None):
    kwargs = super(CheckoutWizard, self)\
        .get_form_kwargs(step, data, files)
    if step == 'delivery-method':
        kwargs['city'] = self.get_cleaned_data_for_step('start')['city']
    return kwargs
}}}

I'm unsure whether all these arguments (step, data, files) are necessary for the new method, though. I'm also unsure if use case is common enough, and whether other ways to solve it without lots of code duplication exist. Although it still would be better if !WizardView followed !FormView's behavior, I guess.

Patch (my first) is pretty small, 5 lines changed (not counting tests and a docstring)."	New feature	closed	contrib.formtools	1.3	Normal	fixed	wizard	Anton Strogonoff	Ready for checkin	1	1	0	0	1	0
