This class allows for the ability to chop up a long form into sizable steps and process each step in sequence. It also provides the ability to go back to a previous step or move on to the next step in the sequence. When the wizard runs out of steps it calls a final function that finishes the form process. This class should be subclassed and the subclass should at a minimum override the done method.
New in version 0.1.
Parameters: |
|
---|
Hook used to cancel a wizard. This will be called when slug is passed that matches “cancel”. By default the method will clear the session data.
Parameters: |
|
---|
Removes the internal wizard state from the session. This should be called right be for the return from a successful done() call.
Responsible for processing the validated form data that the wizard collects from the user. This function should be overridden by the implementing subclass. This function needs to return a HttpResponse object.
Parameters: |
|
---|
Returns the next Step in the sequence after the provided Step. This function will return None if there is no next step.
Parameters: |
|
---|
Returns the previous Step in the sequence after the provided Step. This function will return None if there is no previous step.
Parameters: |
|
---|
Returns the cleaned form data for the provided step.
Parameters: |
|
---|
This will return the form_data dictionary that has been saved in the session. This will mainly be used in the done to query for the form_data that has been saved throughout the wizard process.
Parameters: |
|
---|
Returns the Step that matches the provided slug.
Parameters: |
|
---|
Returns the list of :class:`Step`s used in this wizard sequence.
Parameters: |
|
---|
Responsible for return the path to the template that should be used to render this current form.
Parameters: |
|
---|
Hook used to initialize the wizard subclass. This will be called for every request to the wizard before it processes the GET or POST.
Parameters: |
|
---|
Inserts a new step into the wizard sequence after the provided step.
Parameters: |
|
---|
Inserts a new step into the wizard sequence before the provided step.
Parameters: |
|
---|
Processes the current Step and either send a redirect to the next Step in the sequence or finished the wizard process by calling self.done
Hook used for providing extra context that can be used in the template used to render the current form.
Parameters: |
|
---|
Hook for modifying the SessionWizard‘s internal state, given a fully validated Form object. The Form is guaranteed to have clean, valid data.
This method should not modify any of that data. Rather, it might want dynamically alter the step list, based on previously submitted forms.
Parameters: |
|
---|
Removes step from the wizard sequence.
Parameters: |
|
---|
Renders a form with the provided context and returns a HttpResponse object. This can be overridden to provide custom rendering to the client or using a different template engine.
Parameters: |
|
---|
Sets the cleaned form data for the provided step.
Parameters: |
|
---|