@@ -671,24 +671,22 @@ Usage of ``NamedUrlWizardView``
671
671
.. class:: NamedUrlSessionWizardView
672
672
.. class:: NamedUrlCookieWizardView
673
673
674
- There is a :class:`WizardView` subclass which adds named-urls support to the
675
- wizard. By doing this, you can have single urls for every step. You can also
676
- use the :class:`NamedUrlSessionWizardView` or :class:`NamedUrlCookieWizardView`
677
- classes which preselect the backend used for storing information (server-side
678
- sessions and browser cookies respectively).
674
+ ``NamedUrlWizardView`` is a :class:`WizardView` subclass which adds named-urls
675
+ support to the wizard. This allows you to have separate URLs for every step.
676
+ You can also use the :class:`NamedUrlSessionWizardView` or :class:`NamedUrlCookieWizardView`
677
+ classes which preselect the backend used for storing information (Django sessions and
678
+ browser cookies respectively).
679
679
680
- To use the named urls, you have to change the ``urls.py``.
680
+ To use the named URLs, you should not only use the :class:`NamedUrlWizardView` instead of
681
+ :class:`WizardView`, but you will also have to change your ``urls.py``.
681
682
682
- Below you will see an example of a contact wizard with two steps, step 1 with
683
- "contactdata" as its name and step 2 with "leavemessage" as its name.
683
+ The :meth:`~WizardView.as_view` method takes two additional arguments:
684
684
685
- Additionally you have to pass two more arguments to the
686
- :meth:`~WizardView.as_view` method:
685
+ * a required ``url_name`` -- the name of the url (as provided in the ``urls.py``)
686
+ * an optional ``done_step_name`` -- the name of the done step, to be used in the URL
687
687
688
- * ``url_name`` -- the name of the url (as provided in the urls.py)
689
- * ``done_step_name`` -- the name in the url for the done step
690
-
691
- Example code for the changed ``urls.py`` file::
688
+ This is an example of a ``urls.py`` for a contact wizard with two steps, step 1 named
689
+ ``contactdata`` and step 2 named ``leavemessage``::
692
690
693
691
from django.conf.urls import url, patterns
694
692
@@ -713,9 +711,9 @@ Advanced ``NamedUrlWizardView`` methods
713
711
714
712
.. method:: NamedUrlWizardView.get_step_url(step)
715
713
716
- This method returns the URL for a specific step.
714
+ This method returns the URL for a specific step.
717
715
718
- Default implementation::
716
+ Default implementation::
719
717
720
- def get_step_url(self, step):
721
- return reverse(self.url_name, kwargs={'step': step})
718
+ def get_step_url(self, step):
719
+ return reverse(self.url_name, kwargs={'step': step})
0 commit comments