diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/formtools/form-wizard.txt | 21 | ||||
| -rw-r--r-- | docs/releases/1.7.txt | 7 |
2 files changed, 25 insertions, 3 deletions
diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt index 6a1e328ba8..5fc2a57294 100644 --- a/docs/ref/contrib/formtools/form-wizard.txt +++ b/docs/ref/contrib/formtools/form-wizard.txt @@ -114,11 +114,11 @@ anywhere in your codebase, but convention is to put it in :file:`views.py`. The only requirement on this subclass is that it implement a :meth:`~WizardView.done()` method. -.. method:: WizardView.done(form_list) +.. method:: WizardView.done(form_list, form_dict, **kwargs) This method specifies what should happen when the data for *every* form is - submitted and validated. This method is passed a list of validated - :class:`~django.forms.Form` instances. + submitted and validated. This method is passed a list and dictionary of + validated :class:`~django.forms.Form` instances. In this simplistic example, rather than performing any database operation, the method simply renders a template of the validated data:: @@ -144,6 +144,21 @@ The only requirement on this subclass is that it implement a do_something_with_the_form_data(form_list) return HttpResponseRedirect('/page-to-redirect-to-when-done/') + In addition to ``form_list``, the :meth:`~WizardView.done` method + is passed a ``form_dict``, which allows you to access the wizard's + forms based on their step names. This is especially useful when using + :class:`NamedUrlWizardView`, for example:: + + def done(self, form_list, form_dict, **kwargs): + user = form_dict['user'].save() + credit_card = form_dict['credit_card'].save() + # ... + + .. versionchanged:: 1.7 + + Previously, the ``form_dict`` argument wasn't passed to the + ``done`` method. + See the section :ref:`Advanced WizardView methods <wizardview-advanced-methods>` below to learn about more :class:`WizardView` hooks. diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 255cc35fa3..b22890c301 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -310,6 +310,13 @@ Minor features ``html_email_template_name`` parameter used to send a multipart HTML email for password resets. +:mod:`django.contrib.formtools` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* Calls to :meth:`WizardView.done() + <django.contrib.formtools.wizard.views.WizardView.done>` now include a + ``form_dict`` to allow easier access to forms by their step name. + :mod:`django.contrib.gis` ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
