@@ -714,24 +714,22 @@ Usage of ``NamedUrlWizardView``
714
714
.. class:: NamedUrlSessionWizardView
8000
td>715
715
.. class:: NamedUrlCookieWizardView
716
716
717
- There is a :class:`WizardView` subclass which adds named-urls support to the
718
- wizard. By doing this, you can have single urls for every step. You can also
719
- use the :class:`NamedUrlSessionWizardView` or :class:`NamedUrlCookieWizardView`
720
- classes which preselect the backend used for storing information (server-side
721
- sessions and browser cookies respectively).
717
+ ``NamedUrlWizardView`` is a :class:`WizardView` subclass which adds named-urls
718
+ support to the wizard. This allows you to have separate URLs for every step.
719
+ You can also use the :class:`NamedUrlSessionWizardView` or :class:`NamedUrlCookieWizardView`
720
+ classes which preselect the backend used for storing information (Django sessions and
721
+ browser cookies respectively).
722
722
723
- To use the named urls, you have to change the ``urls.py``.
723
+ To use the named URLs, you should not only use the :class:`NamedUrlWizardView` instead of
724
+ :class:`WizardView`, but you will also have to change your ``urls.py``.
724
725
725
- Below you will see an example of a contact wizard with two steps, step 1 with
726
- ``"contactdata"`` as its name and step 2 with ``"leavemessage"`` as its name.
726
+ The :meth:`~WizardView.as_view` method takes two additional arguments:
727
727
728
- Additionally you have to pass two more arguments to the
729
- :meth:`~WizardView.as_view` method:
728
+ * a required ``url_name`` -- the name of the url (as provided in the ``urls.py``)
729
+ * an optional ``done_step_name`` -- the name of the done step, to be used in the URL
730
730
731
- * ``url_name`` -- the name of the url (as provided in the urls.py)
732
- * ``done_step_name`` -- the name in the url for the done step
733
-
734
- Example code for the changed ``urls.py`` file::
731
+ This is an example of a ``urls.py`` for a contact wizard with two steps, step 1 named
732
+ ``contactdata`` and step 2 named ``leavemessage``::
735
733
736
734
from django.conf.urls import url
737
735
@@ -756,9 +754,9 @@ Advanced ``NamedUrlWizardView`` methods
756
754
757
755
.. method:: NamedUrlWizardView.get_step_url(step)
758
756
759
- This method returns the URL for a specific step.
757
+ This method returns the URL for a specific step.
760
758
761
- Default implementation::
759
+ Default implementation::
762
760
763
- def get_step_url(self, step):
764
- return reverse(self.url_name, kwargs={'step': step})
761
+ def get_step_url(self, step):
762
+ return reverse(self.url_name, kwargs={'step': step})
0 commit comments