Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
bc2bfbad
Kaydet (Commit)
bc2bfbad
authored
May 17, 2014
tarafından
Erik Romijn
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Fixed #22644 -- Clarified documentation for NamedUrlWizardView
Backport of
727d048f
from master.
üst
0594d2d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
form-wizard.txt
docs/ref/contrib/formtools/form-wizard.txt
+16
-18
No files found.
docs/ref/contrib/formtools/form-wizard.txt
Dosyayı görüntüle @
bc2bfbad
...
@@ -722,24 +722,22 @@ Usage of ``NamedUrlWizardView``
...
@@ -722,24 +722,22 @@ Usage of ``NamedUrlWizardView``
.. class:: NamedUrlSessionWizardView
.. class:: NamedUrlSessionWizardView
.. class:: NamedUrlCookieWizardView
.. class:: NamedUrlCookieWizardView
There is a :class:`WizardView` subclass which adds named-urls support to the
``NamedUrlWizardView`` is a :class:`WizardView` subclass which adds named-urls
wizard. By doing this, you can have single urls for every step. You can also
support to the wizard. This allows you to have separate URLs for every step.
use the :class:`NamedUrlSessionWizardView` or :class:`NamedUrlCookieWizardView`
You can also
use the :class:`NamedUrlSessionWizardView` or :class:`NamedUrlCookieWizardView`
classes which preselect the backend used for storing information (
server-side
classes which preselect the backend used for storing information (
Django sessions and
sessions and
browser cookies respectively).
browser cookies respectively).
To use the named urls, you have to change the ``urls.py``.
To use the named URLs, you should not only use the :class:`NamedUrlWizardView` instead of
:class:`WizardView`, but you will also have to change your ``urls.py``.
Below you will see an example of a contact wizard with two steps, step 1 with
The :meth:`~WizardView.as_view` method takes two additional arguments:
``"contactdata"`` as its name and step 2 with ``"leavemessage"`` as its name.
Additionally you have to pass two more arguments to the
* a required ``url_name`` -- the name of the url (as provided in the ``urls.py``)
:meth:`~WizardView.as_view` method:
* an optional ``done_step_name`` -- the name of the done step, to be used in the URL
* ``url_name`` -- the name of the url (as provided in the urls.py)
This is an example of a ``urls.py`` for a contact wizard with two steps, step 1 named
* ``done_step_name`` -- the name in the url for the done step
``contactdata`` and step 2 named ``leavemessage``::
Example code for the changed ``urls.py`` file::
from django.conf.urls import url, patterns
from django.conf.urls import url, patterns
...
@@ -764,9 +762,9 @@ Advanced ``NamedUrlWizardView`` methods
...
@@ -764,9 +762,9 @@ Advanced ``NamedUrlWizardView`` methods
.. method:: NamedUrlWizardView.get_step_url(step)
.. method:: NamedUrlWizardView.get_step_url(step)
This method returns the URL for a specific step.
This method returns the URL for a specific step.
Default implementation::
Default implementation::
def get_step_url(self, step):
def get_step_url(self, step):
return reverse(self.url_name, kwargs={'step': step})
return reverse(self.url_name, kwargs={'step': step})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment