stephrdev/django-formwizard — pull request #34 by gwrtheyrn (2012-03-09 15:30:01+00:00)
Title: Split WizardView into WizardMixin, BaseWizardView and WizardView

Hello

I started using the django-formwizard for a project where we use a CBV based tab navigation. I need to put a form inside a tab.

Using the current generic views, this works without any problem, by adding the generic FormMixin to my views. But django-formwizard doesn't really work that way.

In Django's generic CBVs, all views are split into a mixin, a baseview and a view. The mixin extends object and contains no rendering logic. The baseview contains the mixin and rendering logic, but no template output. The final view extends the baseview but adds template output.

I tried to add this behavior to django-formwizard. Currently it's just a quick change, for which I'd like to get some feedback. The changes don't break any existing code. In case other people think this is a good change, I'd add some documentation to it.

One thing that doesn't worke nicely, but can't be fixed without breaking existing code, is the `get_context_data` method. All builtin generic views only accept `self, **kwargs` as arguments, but django-formwizard accepts `self, form, *args, **kwargs` as arguments. This means that any standard-conform mixins on top of the formwizard break it.

What do you think about those changes? Can they be improved further? Would you provide baseviews for all view extensions like the `SessionWizardView`?

If the changes look good, I'll probably file them as a bug request in the Django bugtracker after some improvements.