mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #17163 -- Added the NamedUrlWizardView.get_step_url()
method. Thanks, Bradley Ayers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17235 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1ef6841cad
commit
355f7fc564
2 changed files with 24 additions and 11 deletions
|
@ -557,8 +557,8 @@ an ``instance_dict`` argument that should contain instances of ``ModelForm`` and
|
|||
``ModelFormSet``. Similarly to :attr:`~WizardView.initial_dict`, these
|
||||
dictionary key values should be equal to the step number in the form list.
|
||||
|
||||
Usage of NamedUrlWizardView
|
||||
===========================
|
||||
Usage of ``NamedUrlWizardView``
|
||||
===============================
|
||||
|
||||
.. class:: NamedUrlWizardView
|
||||
|
||||
|
@ -595,3 +595,15 @@ Example code for the changed ``urls.py`` file::
|
|||
url(r'^contact/(?P<step>.+)/$', contact_wizard, name='contact_step'),
|
||||
url(r'^contact/$', contact_wizard, name='contact'),
|
||||
)
|
||||
|
||||
Advanced ``NamedUrlWizardView`` methods
|
||||
=======================================
|
||||
|
||||
.. method:: NamedUrlWizardView.get_step_url(step)
|
||||
|
||||
This method returns the URL for a specific step.
|
||||
|
||||
Default implementation::
|
||||
|
||||
def get_step_url(self, step):
|
||||
return reverse(self.url_name, kwargs={'step': step})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue