Previous topic

SessionWizard

Next topic

WizardState

This Page

Step

class merlin.wizards.utils.Step(slug, form)[source]

When constucting a form wizard, the wizard needs to be composed of a sequental series of steps in which it is to display forms to the user and collect the data from those forms. To be able to provide these forms to the SessionWizard, you must first wrap the Django django.forms.Form in a Step object. The Step object gives the ability to store the django.forms.Form class to be used, as well as, a unique slug to be used in the wizard navigation.

New in version 0.1.

Parameters:
  • slug – Each step in the wizard should have a unique “slug” that identifies that Step in the process. By using slugs the wizard has the ability to go forward, as well as, back in the process adjusting what data it collects from the user.
  • form – This MUST be a subclass of django.forms.Form or django.forms.ModelForm. This should not be an instance of that subclass. The SessionWizard will use this class to create instances for the user. If going back in the wizard process, the SessionWizard will prepopulate the form with any cleaned data already collected.