Hi Jannis,
>> So, what do you think. Should we try to move forward to a ViewWizard?
> *jumps in time machine*
> Done! See [1] for the work Stephan and me did a few months ago.
This really is nice, I like seeing the old FormWizard becoming more
flexible and reusable. But not what I intended.
The new WizardView still handles a list of forms to be rendered. What I
proposed is completely moving away from the FormWizard...meaning instead
of passing a list of forms a ViewWizard should get a list of views. Each
view could then a) save/restore its state using some storage api and b)
tell the wizard about its state (step is complete) to allow moving to
the next step.
In code this could look like:
class Step1View(FormView):
form_class = ...
class Step2View(TemplateView):
template_name = ...
class DoneView(WizardDoneView):
# done() method could be moved to an own step, giving it
# much more power. This is how my current prototype works.
...
wizard_view = ViewWizard.as_view(
view_list = (
'step1': Step1View,
'step2': Step2View,
'done': DoneView,
),
)
Using this approach the FormWizard is just a ViewWizard containing of
only FormView's. Besides that you could even use a ViewWizard as a step
inside a ViewWizard (recursion), but thats probably scary to handle ;-)
Anyways the views itself (=steps) would have much more control about
what happens and how the data is processes. The Step2View above could -
for example - point to the next step if some link gets clicked.
Correct me if I'm wrong about the new WizardView.
David
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.